Software AG Products 10.5 | Using API Gateway | Policies | System-defined Stages and Policies | Routing | JMS/AMQP Policies
 
JMS/AMQP Policies
 
Using JMS/AMQP Policy for a SOAP API
Using JMS/AMQP Policy for a REST API
JMS/AMQP Properties
To configure API Gateway for JMS with Message broker native protocol support or JMS with AMQP protocol you need to:
*Create one or more JNDI provider aliases to specify where API Gateway can look up when it needs to create a connection to JMS provider or specify a destination for sending or receiving messages.
*Create one or more connection aliases that encapsulate the properties that API Gateway needs to create a connection with the JMS provider.
JMS/AMQP Routing
You can use this policy when you want to specify a JMS queue or topic to which API Gateway submits the request, and the destination where the response should be routed to where API Gateway waits to listen to the response from the native API.
For example, you can use this policy when you have a native API that is exposed over AMQP or JMS and that requires clients to communicate with the server using other protocols. This policy allows you to bridge protocols between the client and the native API.
You can apply the JMS/AMQP routing policy to both REST and SOAP APIS. The following sections explain their usage.
Use case 1: Using the JMS/AMQP routing policy (JMS with a message broker native protocol) for a SOAP API
This describes the high level workflow for the scenario where you use the JMS/AMQP routing policy (JMS with a message broker native protocol) for a SOAP API.
1. Create an alias to a JNDI Provider For a detailed procedure, see Creating a JNDI Provider Alias.
2. Configure API Gateway to use a JMS connection alias to establish an active connection between API Gateway and the JMS provider. For a detailed procedure, see Creating a JMS Connection Alias.
3. Create a WS (Web Service) JMS Provider endpoint alias and configure the Alias, Description, Type (Provider), Transport Type (JMS) fields and JMS Transport Properties. For a detailed procedure, see Creating an Endpoint Alias for a Provider Web Service Descriptor.
4. A WS (Web Service) endpoint trigger is created when you configure WS (Web Service) JMS Provider endpoint alias. This trigger consists of the input source details like Queue name or Topic name. You can update the WS (Web Service) endpoint trigger, as required. For detailed procedures, see .
5. Select the required API.
6. Click Edit.
7. In the API Details section click Policies.
8. Enforce the JMS/AMQP Routing policy with the following properties configured.
a. Specify the connection URL for connecting to the JMS provider.
b. Specify a queue name where a reply to the message must be sent.
c. Provide a priority of this JMS message.
d. Provide expiration time of the JMS message.
e. Specify the message delivery mode for the request message.
For details on the JMS/AMQP Routing policy, see Using JMS/AMQP Policy for a SOAP API
9. Click Save.
The enforced policy JMS/AMQP Routing with the required configuration now allows any java client to communicate with the API asynchronously.
Use case 2: Using the JMS/AMQP routing policy (JMS with AMQP protocol) for a SOAP API
This describes the high level workflow for the scenario where you use the JMS/AMQP routing policy (JMS with AMQP protocol) for a SOAP API.
1. Configure API Gateway to use JMS with AMQP protocol.
Configure JNDI settings and JMS settings as per the client you are using to achieve JMS over AMQP protocol support.
Note:
For a sample procedure on configuring API Gateway to use JMS with AMQP protocol using Apache qpid libraries, see Configuring API Gateway for JMS with AMQP Protocol
2. Select the required API.
3. Click Edit.
4. In the API Details section click Policies.
5. Enforce the JMS/AMQP Routing policy with the following properties configured.
a. Specify the connection URL for connecting to the JMS provider.
b. Specify a queue name where a reply to the message must be sent.
c. Provide a priority for this AMQP message.
d. Provide expiration time of the AMQP message.
e. Specify the message delivery mode for the request message.
For details on the JMS/AMQP Routing policy, see Using JMS/AMQP Policy for a SOAP API
6. Click Save.
The enforced policy Enable JMS/AMQP with the required configuration now allows all the clients such as Python, Ruby, Java, and Dotnet to communicate with the API asynchronously.
Use case 3: Using the JMS/AMQP routing policy (JMS with a message broker native protocol) for a REST API
This describes the high level workflow for the scenario where you use the JMS/AMQP routing policy (JMS with a message broker native protocol) for a REST API.
1. Create an alias to a JNDI Provider For a detailed procedure, see Creating a JNDI Provider Alias.
2. Configure API Gateway to use a JMS connection alias to establish an active connection between API Gateway and the JMS provider. For a detailed procedure, see Creating a JMS Connection Alias.
3. Select the required API.
4. Click Edit.
5. In the API Details section click Policies.
6. Enforce the JMS/AMQP Routing policy with the following properties configured.
a. Specify the connection alias that contains the configuration information needed to establish a connection to a specific JMS provider.
b. Specify the destination to which the request message is sent.
c. Specify the destination type to which the request message is sent.
d. Specify the destination to which the response message is sent.
e. Specify the type of destination, queue or topic, to which the response message is sent.
f. Provide expiration time of the JMS message.
g. Provide the time for which API Gateway listens for the response message.
h. Specify the message delivery mode for the request message.
For details on the JMS/AMQP Routing policy, see Using JMS/AMQP Policy for a REST API
7. Click Save.
The enforced policy JMS/AMQP Routing with the required configuration now allows any java client to communicate with the API asynchronously.
Use case 4: Using the JMS/AMQP routing policy (JMS with AMQP protocol) for a REST API
This describes the high level workflow for the scenario where you use the JMS/AMQP routing policy (JMS with AMQP protocol) for a REST API.
1. Configure API Gateway to use JMS with AMQP protocol.
Configure JNDI settings and JMS settings as per the client you are using to achieve JMS over AMQP protocol support.
Note:
For a sample procedure on configuring API Gateway to use JMS with AMQP protocol using Apache qpid libraries, see Configuring API Gateway for JMS with AMQP Protocol
2. Select the required API.
3. Click Edit.
4. In the API Details section click Policies.
5. Enforce the JMS/AMQP Routing policy with the following properties configured.
a. Specify the connection alias that contains the configuration information needed to establish a connection to a specific JMS provider.
b. Specify the destination to which the request message is sent.
c. Specify the destination type to which the request message is sent.
d. Specify the destination to which the response message is sent.
e. Specify the type of destination, queue or topic, to which the response message is sent.
f. Provide expiration time of the AMQP message.
g. Provide the time for which API Gateway listens for the response message.
h. Specify the message delivery mode for the request message.
For details on the JMS/AMQP Routing policy, see Using JMS/AMQP Policy for a REST API
6. Click Save.
The enforced policy Enable JMS/AMQP with the required configuration now allows all the clients such as Python, Ruby, Java, and Dotnet to communicate with the API asynchronously.