mq light in microservices
TRANSCRIPT
AMQP
● Advanced Message Queuing Protocol
● Open (OASIS) messaging protocol
● Queuing, pub-sub, point-to-point
MQ Light
● Publish-subscribe messaging (AMQP)● Node.js, Java, Ruby, Python clients● Available in Bluemix
MQ Light
client.send('topic', 'data', function (err, data) {
if (err) {
// Panic
} else {
// Carry on
}
});
REST
if (returnCode != 200) {
if (returnCode == 4XX) {
// Panic
} else if (returnCode == 5XX) {
// Try again maybe?
}
} else {
// Carry on
}
MQ Light
● Durable subscriptions.● Handles transient network issues, downtime
etc.
Publish
ttl: 7 days
MQ Light
● Durable subscriptions.● Handles transient network issues, downtime
etc.
ttl: 7 days
Receive
REST
● Multiple service domains.● Scenario: build service(s) and test service(s)● Test service needs to know when building is
done.
Build domain Test domain
REST
● Build service calls test service on completion.● Becomes responsible for kicking off tests.
Build domain Test domain
REST
REST
● Notify the user of build completions?● Microservices accrue responsibilities.
Build domain Test domain
REST
MQ Light
● Build service publishes on completion.● Interested services subscribe.
Build domain Test domainPublish Subscribe
MQ Light
● No need to update existing services.● No growth of responsibility.
Build domain Test domainPublish Subscribe
Subscribe
https://developer.ibm.com/messaging/mq-light/
https://www.amqp.org/
References
https://blog.dropletpay.com/lessons-learnt-building-a-microservice-architecture/
Image credit
Peter Roberts https://www.flickr.com/photos/peter_roberts/4413775212