Webhooks integration using solace and webmethods.io

rajeshdns
rajeshdns Member Posts: 30 ✭✭
edited November 2020 in Blogs & Tutorials #1

Webhooks is technique in Event Driven Architecture to notify the events, webhooks are user defined HTTP callbacks.
In this example, publisher configured in Solace and subscriber is in webmethods.io to process and push the event to call back URL.
webmethods.io : SAG iPaaS for Integration.
Lets begin:
1. Have created publisher application in the Solace Event Portal as a event manager on the particular topic, subscriber will be configured in the webmethods.io

  1. Create a flow in webmethods.io to subscribe for the events and trigger the Webhooks (HTTP callbacks).
    Step 1: in webmethods.io portal, create new flow by going to workflow page.
    Step 2: Select the trigger, solace allows provides multiple options to connect with different protocols like AMQP, MQTT, REST, SMT over TCP. In the current example, chosen MQTT as trigger to consume the message, configure the MQTT connection details along with topic to listen events.
  2. Select the HTTP connector to configure the call back URL.


4. Click on edit to configure the call back URL along with security configuration to connect to server.


5. Drag the message which is received from MQTT to body field as part of the configuration.

  1. End the flow and save.

SOR (System Of Record) push the data to topic which is configured at solace when ever the event occurs, In webMethods.io, flow picks up the event and post the data to callback url's.
In the current example, logic at the callback server is, send the email notification of the event data.

Run the example:
1. message published to the topic

2. message was consumed push's the data to the configured webhooks url and internally the callback server triggers the notification to the configured mail recipient.

Comments

  • Tamimi
    Tamimi Member, Administrator, Employee Posts: 491 admin

    This looks interesting! I have not played around with webmethods.io before, I'm gna have to check it out. Have you looked into the RDP (Rest Delivery Point) feature of the broker? It's basically a way to integrate pub/sub with REST where you can configure the callback link to the email server in the broker directly without needing to use a webhook integration (like webmethods). That way you will have one less configuration to worry about, so basically it will be Publisher publishing events to the broker on a predefined topic and the broker will trigger the callback server url that is configured to send emails.

    We have a codelab tutorial that talks about that you might be interested to check it out https://codelabs.solace.dev/codelabs/solace-event-enable-rest

  • rajeshdns
    rajeshdns Member Posts: 30 ✭✭

    Yes, have checked the RDP , my intension is to do
    1)Leverage any other service capabilities needed which are required before calling the call back url (like transformation.. )
    2) Most of the clients will already have their existing API Management platforms integrating to their integration solutions, so trying to decouple to show case seamlessly we can connect to leverage your API capabilities without re building their portal (not necessary)..

  • rajeshdns
    rajeshdns Member Posts: 30 ✭✭

    @Tamimi , regarding the RDP, do we have REST API end point to register the call back urls along with some required configurations like, auth details if I want to automate it as part of the api registration.

    Rgds
    ..Rajesh

  • Tamimi
    Tamimi Member, Administrator, Employee Posts: 491 admin

    Hey Raj! Apologies for the late reply - yes there is a REST API end point for configuring your broker if that is what you are referring to. SEMP V2 (Solace Element Management Protocol) is a REST API you can use to configure your broker and that way you can automate the configuration part.

    Note that there are three ways you can configure you can configure your message broker
    1. UI
    2. API (using SEMP v2)
    3. CLI

    To see how you can configure the RDP in particular using the SEMP API checkout the codelab (in particular step 4 and Step 12). Let me know how this goes, curious to help out along the way 👍 @rajeshdns