Site iconAxway Blog

Axway + Solace Part 2: Axway API Gateway + the Solace REST Client

Perhaps the biggest barrier to adopting an Event-Driven architecture is modernizing legacy applications. Despite the value of this transformation, legacy applications are hard to maintain and brittle—and refactoring them is less than ideal. The Solace Event Broker takes a lot of the complexity out of building/maintaining queues and setting up the routing, however, messages must contain a Topic to publish them to the correct queue. This is where Axway can help.

This post is part of a five-part series covering the following topics:

  1. Getting Started with Solace’s REST Client
  2. Enhancing Legacy Messages – Axway API Gateway and Solace REST Client
  3. Enhancing Legacy Messages – Axway API Gateway and Solace JMS Client
  4. Integrating 3rd Party Cloud Apps – Axway Application Integration and Solace
  5. Evolving Request/Response APIs to Events – Axway Streams and Solace

Axway API Gateway and Solace REST Client

In this, the second in the series of blog posts detailing Axway’s integration with Solace PubSub+ Event Broker, I explore taking a sample message and enhancing it in the Axway API Gateway with the appropriate headers and topic to allow the Solace REST Client to route it to the proper queue.

For this sample, I use the message body as a source to extract the Topic, but it could also come from a Header, a query parameter, or even additional policy logic in the API Gateway that mapped some message context (IP, Cert Issuer, etc.) to a Topic list.

To do this, we will use Postman as a client to POST a JSON message to the API Gateway. The API Gateway will parse the message to extract a key-value pair that can be used as the Topic. The API Gateway will then enhance the message with Headers as needed to integrate with the Solace Event Broker, then dynamically publish the message to the appropriate Solace Event queue using their REST Client.

Prerequisite Knowledge

Configure Solace to Listen for Enhanced Message

You should now be Subscribed to a queue, which will display messages in real-time as they are delivered to the Solace Event Broker. You should have captured your REST Host, Username, Password, and Topic Name for use in the next section.

Configure the API Gateway Policy

{

“content”: “body”,

“topic”: “test/axway”

}

 

At this point, you should have a basic APIGW policy that can extract a topic from an inbound message and dynamically route it to the appropriate Solace Topic queue. Instead of extracting it from the message, you could get it from a query parameter, HTTP Header, or even look at the message context (e.g., app name, organization, API endpoint, etc.) and maintain a topic mapping list to use. This is just a basic example of one way this could work.

Test the policy with Postman

Conclusion

This post showed how we can transform and enhance a message to integrate with the Solace Event Broker REST Client. A similar policy could be used as a Routing or Response policy in Axway API Manager to enhance easily an existing API to work with the Solace Event Broker. This process could also be adapted to Axway AMPLIFY Streams or API Builder to do similar integrations with Solace.

In my next post, I will explore using the Axway API Gateway to connect with Solace via JMS.

Learn how to Get Started with Solace’s REST Client.

 

Exit mobile version