+ All Categories
Home > Technology > Mule AMQP connector examples

Mule AMQP connector examples

Date post: 13-Apr-2017
Category:
Upload: cong-thanh-nguyen
View: 251 times
Download: 0 times
Share this document with a friend
31
Mule AMQP Connector Examples Thanh Nguyen
Transcript
Page 1: Mule AMQP connector examples

Mule AMQP Connector Examples

Thanh Nguyen

Page 2: Mule AMQP connector examples

Connection Fallback

• You can define a list of <host>:<port> or <host> brokers to try to connect to in case the main one fails to connect

Page 3: Mule AMQP connector examples

Connection Fallback

• The fallbackAddresses attribute is a comma-separated list of brokers that you can specify as "host:port" or "host“

• The addresses are used along with the main one each time a connection is attempted: if the first attempt fails (main address), the next address is used to attempt connecting, and so on

Page 4: Mule AMQP connector examples

Reconnection Strategy

• The first broker you specify in the list is called the main address or the master broker

• The non-master brokers are only connected to if the master broker fails

• If the master broker fails, control passes to the next broker in the list

• If that broker fails and if the master broker has returned to being online, control passes back to the master broker

Page 5: Mule AMQP connector examples

Reconnection Strategy

• If the master broker is still offline, control passes to the next broker in the list that is online

• If fallback is not set and the master broker is not responding, AMQP fails

• If fallback is set and the master broker is not responding, fallback occurs, and control moves to the next broker in the list

Page 6: Mule AMQP connector examples

Listening to Messages with Exchange Redeclaration and Queue Creation

Page 7: Mule AMQP connector examples

Listening to Messages with Exchange Redeclaration and Private Queue Creation

Page 8: Mule AMQP connector examples

Listening to Messages on a Pre-Existing Exchange

Page 9: Mule AMQP connector examples

Listening to Messages on a Pre-existing Queue

Page 10: Mule AMQP connector examples

Listening to Messages on a Declared But Unbound Queue

Page 11: Mule AMQP connector examples

Manual Message Acknowledgment and Rejection

Page 12: Mule AMQP connector examples

Manual Channel Recovery

Page 13: Mule AMQP connector examples

Flow Control

Page 14: Mule AMQP connector examples

Publishing Messages to a Redeclared Exchange

Page 15: Mule AMQP connector examples

Publishing Messages to a Pre-Existing Exchange

Page 16: Mule AMQP connector examples

Publishing Messages to a Pre-Existing Exchange

• configuring the connector to perform passive declarations:

Page 17: Mule AMQP connector examples

Declaring and Binding an Outbound Queue

Page 18: Mule AMQP connector examples

Message-Level Override of Exchange and Routing Key

• It’s possible to override some outbound endpoint attributes with outbound-scoped message properties: – routing-key overrides the routingKey attribute– exchange overrides the exchangeName attribute

Page 19: Mule AMQP connector examples

Mandatory and Immediate Deliveries and Returned Message Handling

Page 20: Mule AMQP connector examples

Mandatory and Immediate Deliveries and Returned Message Handling

• It’s also possible to define the returned message endpoint at flow level:

Page 21: Mule AMQP connector examples

Request-Response Publication

Page 22: Mule AMQP connector examples

Transaction Support

• Declares an AMQP inbound endpoint that starts a new transaction for each newly-received message:

Page 23: Mule AMQP connector examples

Transaction Support

• The following declares a transacted AMQP bridge:

Page 24: Mule AMQP connector examples

Transaction Support

• Configure a recoverStrategy attribute on the transaction element, as shown below:

Page 25: Mule AMQP connector examples

Exchange and Queue Declaration Arguments

Page 26: Mule AMQP connector examples

Programmatic Message Requesting

• Optional parameters in square brackets:

• a pre-existing queue named "my-queue", to be consumed with a unique AMQP connector available in the Mule configuration:

Page 27: Mule AMQP connector examples

Programmatic Message Requesting

• routing key on the specified connector:

• retrieve a message from the queue using the Mule Client

Page 28: Mule AMQP connector examples

SSL Connectivity

• use the AMQPS connector with the XML namespace declaration listed below

• Connect using SSLv3 (default) and use a trust manager that accepts all certificates as valid:

Page 29: Mule AMQP connector examples

SSL Connectivity

• Connect using TLS and use a trust manager that accepts all certificates as valid:

• Connect using SSLv3 (default) and use a custom trust manager:

Page 30: Mule AMQP connector examples

SSL Connectivity

• Connect using TLS and use a custom trust manager:

• Connect with key and trust stores:

<amqps:connector name="amqpsTlsKeyStores"> <amqps:ssl-key-store path="keycert.p12" type="PKCS12" algorithm="SunX509" keyPassword="MySecretPassword" storePassword="MySecretPassword" /> <amqps:ssl-trust-store path="trustStore.jks" type="JKS" algorithm="SunX509" storePassword="rabbitstore" /> </amqps:connector>

Page 31: Mule AMQP connector examples

Question and answer


Recommended