com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links' is unknown.

Using Inbound Endpoints

In this sample scenario, you will use an Inbound Endpoint to expose an already defined REST API through a different port. You can reuse the REST API that was defined in the Sending a Simple Message to a Service tutorial. See Creating an Inbound Endpoint for details on how to work with inbound endpoints using WSO2 Integration Studio.

Before you begin,

  1. Download the product installer from here, and run the installer.
    Let's call the installation location of your product the <EI_HOME> directory. This is located in a place specific to your OS as shown below:
    OSHome directory
    Mac OS/Library/WSO2/EnterpriseIntegrator/6.6.0
    WindowsC:\Program Files\WSO2\EnterpriseIntegrator\6.6.0\
    Ubuntu/usr/lib/wso2/EnterpriseIntegrator/6.6.0
    CentOS/usr/lib64/EnterpriseIntegrator/6.6.0
  2. Select and download the relevant WSO2 Integration Studio ZIP file based on your operating system from here and then extract the ZIP file. 
    The path to this folder will be referred to as <EI_TOOLING> throughout this tutorial.

    Getting an error message? See the troubleshooting tips given under Installing WSO2 Integration Studio.

  3. If you did not try the Sending a Simple Message to a Service tutorial yet, open the WSO2 Integration Studio, click File, and click Import.
    Next, expand the WSO2 category and select Existing WSO2 Projects into workspace, click Next and upload the pre-packaged project.
    This contains the configurations of the Sending a Simple Message to a Service tutorial so that you do not have to repeat those steps.

Let's get started!

Configuring an Inbound Endpoint

  1. Once you have exported the ESB project as described in above, the project directory will appear with the artifacts as shown below. Note the 'HealthcareAPI' that is already included.


  2. Right-click on SampleServices and navigate to New -> Inbound Endpoint. Select Create A New Inbound Endpoint and click Next.

  3. Enter the following details and click Finish.

    Inbound Endpoint NameQueryDoctorInboundEndpoint
    Inbound Endpoint Creation TypeHTTP

  4. Go to the Properties tab in the Design view and enter the following:

    Inbound HTTP port8285
    Dispatch Filter Pattern/healthcare/querydoctor/.*

The endpoint will now get mapped to any URL that matches the above pattern provided. You will be exposing the health care API on a new port through this inbound endpoint. 

Deploying the Inbound Endpoint

  1. Open the pom.xml file under the SampleServicesCompositeApplication project from the project explorer. 

  2. See that the newly added 'QueryDoctorInboundEndpoint' artifact is listed under Dependencies. Select this artifact to add it to the composite application project.


  3. Save your changes.

  4. Open the Getting Started view and click Miscellaneous →Add New Server to open the New Server dialog. 

  5. In the New Server dialog, expand the WSO2 folder and select the version of your server.
  6. Click Next. In the CARBON_HOME field, provide the path to your product's home directory, and then click Next again.
  7. Review the default port details for your server and click Next.

  8. To deploy the CApp project to your server, select the SampleServicesCompositeApplication project from the list, click Add to move it into the configured list, and then click Finish.

  9. On the Servers tab, note that the server is currently stopped. Click the 'play' icon on the tool bar. If prompted to save changes to any of the artifact files you created earlier, click Yes

  10. As the server starts, the Console tab appears. Note messages indicating that the composite app was successfully deployed.

Starting the back-end service

Download and start the back-end service:

  1. Download the JAR file of the back-end service.
  2. Open a terminal and navigate to the location where your saved the back-end service.

  3. Execute the following command to start the service:

    java -jar Hospital-Service-JDK11-2.0.0.jar

The Healthcare service is now active and you can start sending requests to the service.

Invoking the Inbound Endpoint

Let's send a message to the healthcare REST API on the 8285 port.

  1. Open a command line terminal and execute the following command: 

    curl -v http://localhost:8285/healthcare/querydoctor/surgery
  2. You will get the response shown below. The inbound endpoint has successfully invoked the REST API, and further, the response received by the REST API has been routed back to client through the inbound endpoint.

    [{"name":"thomas collins","hospital":"grand oak community 
       hospital","category":"surgery","availability":"9.00 a.m - 11.00 a.m","fee":7000.0},
     {"name":"anne clement","hospital":"clemency medical center","category":"surgery","availability":"8.00 a.m - 10.00 A.m","fee":12000.0},
     {"name":"seth mears","hospital":"pine valley community hospital","category":"surgery","availability":"3.00 p.m - 5.00 p.m","fee":8000.0}]
com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links2' is unknown.