Publishing XML Events via RabbitMQ¶ Purpose¶ This application demonstrates how to configure WSO2 Integrator: SI to send sweet production events via RabbitMQ transport in XML format, and view the output via your AMQP consumer. Prerequisites¶ Install the rabbitmq Siddhi extension. For instructions, see Downloading and Installing Siddhi Extensions. A running RabbitMQ broker. For installation instructions, see the RabbitMQ download page. An AMQP 0-9-1 consumer to verify the output, e.g., the RabbitMQ Management plugin, the rabbitmqadmin CLI, or any AMQP client library. Try it out¶ Make sure your RabbitMQ broker is running and reachable at amqp://guest:guest@localhost:5672. Start consuming messages from the RABBITMQSAMPLE exchange using your preferred AMQP consumer. Start the Siddhi application by clicking Run. The following message appears in the console: PublishRabbitmqInXmlFormat.siddhi - Started Successfully! Connection error? If you see a connection error to localhost:5672, the RabbitMQ broker may not be running, or port 5672 may be in use. Verify your RabbitMQ instance is reachable, or change the URI in the sink configuration. Send events using the Event Simulator. For instructions, see Testing Siddhi Applications. Use the following values: Field Value Siddhi App Name PublishRabbitmqInXmlFormat Stream Name SweetProductionStream name toffee amount 45.24 Send a few more events with different values. Your AMQP consumer receives XML-encoded events from the RABBITMQSAMPLE exchange. The decoded payload corresponds to the LowProductionAlertStream schema. Siddhi application¶ @App:name("PublishRabbitmqInXmlFormat") @App:description("demonstrates how to configure WSO2 Integrator: SI to send sweet production events via RabbitMQ transport in XML format, and view the output via your AMQP consumer") define stream SweetProductionStream (name string, amount double); @sink(type ='rabbitmq', uri = 'amqp://guest:guest@localhost:5672', exchange.name = 'RABBITMQSAMPLE', @map(type='xml')) define stream LowProductionAlertStream (name string, amount double); from SweetProductionStream select * insert into LowProductionAlertStream;