Connecting to AMQP with MuleSoft

Desy Kristianti @dessskris

Agenda

  • What is AMQP?
  • Why use messaging queues?
  • Using the AMQP Connector in MuleSoft
  • Live demo
  • Error handling

@dessskris #CodenameMAXINE

About Me

Desy Kristianti

Integration Developer at Deloitte

Organiser at Women Techmakers Belfast

Founder at The SPUDS Belfast

@dessskris #CodenameMAXINE

What is AMQP?

  • Open source international standard
  • Asynchronous messaging between applications
  • The message vehicle & transport mechanism
  • Latest protocol: 1.0
  • Mule-supported protocol: 0-9-1

@dessskris #CodenameMAXINE

The AMQP Model

Source: http://www.amqp.org/specification/0-9-1/amqp-org-download

Components:

  • Exchange
  • Message queue 
  • Binding

@dessskris #CodenameMAXINE

How does it work?

Source: http://www.amqp.org/specification/0-9-1/amqp-org-download

  1. The publisher application sends a message & routing key to Exchange
  2. The message is routed according to Bindings to its corresponding Queue
  3. The message is ready to be consumed
  4. The consumer application can consume and ack or reject this message, or requeue it

@dessskris #CodenameMAXINE

Why use messaging queues?

  • Handle all asynchronous requests reliably
  • Added resilience if the processing system is down
  • Route and distribute messages according to business rules
  • Allow loosely coupled systems to communicate easily

Photo by Daniel Bradley on Unsplash

@dessskris #CodenameMAXINE

How do we do this with MuleSoft?

Check out this live demo!

See repo on https://github.com/dessskris/amqp-mulesoft/

@dessskris #CodenameMAXINE

AMQP error handling on MuleSoft

  • Save attributes.ackId if using manual acknowledgement
  • Reject the message in error handler
  • Where appropriate, post status updates to another queue
  • When the message completes processing in another API,
    they can post status updates to this queue

@dessskris #CodenameMAXINE

Conclusion

  • AMQP allows applications to send messages to each other
  • Publish to an Exchange, routing with Bindings, consume from the Queue
  • Reliable asynchronous messaging with added resilience
  • Achievable on MuleSoft using AMQP 0-9-1

@dessskris #CodenameMAXINE

Photo by Toa Heftiba on Unsplash

Thank you!

Desy Kristianti

https://slides.com/dessskris/amqp-mulesoft

dessskris@gmail.com

Desy Kristianti

@dessskris

References

@dessskris

AMQP with MuleSoft

By Desy Kristianti

AMQP with MuleSoft

  • 562