mq light in microservices

20
AMQP/MQ Light as a Microservice transport @Steve_Upton

Upload: steve-upton

Post on 08-Aug-2015

120 views

Category:

Software


2 download

TRANSCRIPT

AMQP/MQ Light as a Microservice transport

@Steve_Upton

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

REST

if (returnCode != 200) {

// Panic

} else {

// Carry on

}

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

MQ Light

● Relief valve built right into the pipe.

Link credit

vs

Dumb pipes or simple pipes?

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

Publish everything!(Tom Livesey, Droplet)

Buildosaurus

● Let everyone know when the build was bad.

● No changes to the back-end code!

“Messaging is great!”(Steve Upton, IBM)

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