SK SKYVVA Documentation

123.3 How to use RabbitMQ Outbound Adapter with JSON Payload?

Rabbit MQ differs from Active MQ and other message brokers in a way that we need to post a message to an Exchange provided by it. This Exchange will then forward the message to a queue or topic based on the routing key property. This adapter supports 3 types of data formats i.e. CSV, XML, and JSON. [su_box title="Note" box_color="#2a8af0" title_color="#000000"] We can check JSon Data on RabbitMQ Server:  Link:http://18.197.54.48:15672/#/queues. Where exchange will be automatically created once you callout code. [/su_box]

UseCase: Agent RabitMQ Adapter for JSON payload.

Objective: Test rabbitMQ outbound adapter for Json Format

Pre-requisite:

Example:

Steps:

Step1:To Create Agent RabbitMQ JSONOutbound Adapter:

Input values for Mandatory Properties

Configure Agent RabbitMQ JSON Outbound Adapter: you need to enter adapter properties base on system requirement and Select Connection Destination (Example:AgentLinux). Step2: Create Outbound Interface:

step4: Do mapping and save it.

Step5: Go to Developer console and callout: Callout: skyvvasolutions.CallOutControl c = new skyvvasolutions.CallOutControl(); c.returnJSONComplete=true; c.actionDoIntegrate=false; c.isCreateMessage=true; String[] ids= new String[]{'0011j000012KfGvAAK','0011j0000120pa3AAA'}; List result = skyvvasolutions.Iservices.invokeCalloutV3('Agent_new _adapter','RabitMQ_outbound_JSON',ids,'SYNC',c); Step5: Check result on Message Monitoring:

RabbitMQ Server:

Check JSON Data on RabbitMQ Server:

Go to Exchange After V3 Callout new Exchange is generated Example: RabitMQ_outbound_JSON (Note: RabitMQ_outbound_JSON Exchange name is coming from adapter configuration)

Click on the Exchange name, It will redirect you to the Exchange detail page.

Click on Queue -2129888673 It will navigate to the get the message section.

Open this article in the interactive viewer →