`

[演讲] Multi-Platform Messaging with RabbitMQ

 
阅读更多

Rob Harrop的演讲《Multi-Platform Messaging with RabbitMQ》,这是第一次听到SpringSource的大神的演讲,有听译下来的冲动。

 

[2012.03.31 4:17PM]

 

Hello everybody, em...welcome back from your break, em...I'd like to take a few miniutes to thank Arjen and Nil for that keynote contents, because they perfectly [] what we are going to talk about today. Nil's talk was great, because he was trying to give us insight into what's coming next in Java and [judging] by the content on twitter, some people convince, some people happy that we've got some new development, and some furture direction, and i think we all agree that it's nice that finally the platform has got some kind of forward direction. but it can't help but feel that it's still not enough all the [ivitation] has happening in all the languages all the platform doesn't seen to be presented there in the core java language.

 

In yestoday's keynote, Argen was talking about the clouding environments where you got applications in mulitiply languages communicating over a share messaging [fabrick], well, in today's talk, we are going to talk a lot about that, I gonna show you how that works, it's quick, know about who I am.

longer ago I was a cofounder of SpringSource, and a springframe commiter, i've done that for 4 years now. after that I was the creator of the SpringSource dm Server, project and osgi based application server that about 18 months ago went to the eclipse project that became vergo, and now i just spend my days working on rabbitmq and coding in Erlang.

 

we gonna do 4 interesting things today, we going to look the rabbitmq and messaging protocol amqp,very quick diving in what amqp is, what's it means to used Java developer, and think most importantly how it's different from what your proberbly used to JMS, we're going to look at a stomp which is very interesting cross platform messaing protocol based around simple textual frames that came out from the amqp project, obviously we gonna do some fancy nodejs, socket io goodness and proberbly at some point thing go wrong because we gonna demo in java,phthon,ruby,javascript and erlang and telnet,so we'll see if we can pull it off.

 

all the code is in my github repository, getting the code, yes very glip, em, so please you must stop that was a  joke i'm trained yestoday, please feel free to check this out when you get home, play arount the examples or the repositories, you what you need to do everything is there if you to try.

 

before we start to code, i want to explain a little bit about rabbitmq and about amqp, coming to the Java background, i think most people have very fixed idea about how messaing works, and idea tends to be based on how JMS works, this can cause all manner of confusion in AMQP. 

 

so RabbitMQ is different from a lot of messaing brokers and that it is natively motive protocol, it doesn't just talk a protocol and expect you to allways talk in the same way. so does using amqp as the based protocol but we have all the protocols lays on top of it, stomp, smtp, pop3 there a number of protocols seems to grow daily as a rabbit team come up with some new well wonderful ware exstanding broker.

 

and i think it was very nice to see the rabbit is the share number of bindings in different languages. the rabbit team produces Java, erlang, .NET clients or the commnunity produces the clients python, ruby, php, object-c, c++, scheme, haskell, loads of different languages. so if you have need to communicate between different languages using a robust platform, rabbitmq proberly is the best way to do so.

 

AMQP is the core protocol, that you gonna to deal with using rabbitmq, most of the time you gonna talk cross languages using the amqp, because this is the eassies way to get a good policy language binding.

the most important thing you can know about amqp is it's not jms, do not think, ah, jms topics, jms queues, they ain't be the same thing in amqp, that is not true, if you try to go that rule, nothing will work with you expected to work.

 

you need to forget what you know about jms and try to relearn how messaing works, try to rediscover [yes] of messaging, how to get that work that's in there how is representation yestoday .

 

amqp has two basic concepts, queues and exchanges, if you're consumer, you're consuming messages from queues, if you're producer, you're sending messages to exchanges which then routed to the queues. you never address the queue directly as a producer, very simple, interesting [low] dialgram here we can see we've got queue stock.prices and three consumers, a queue can have any number of consumers touched to it, well, or importantly each message is only consumed by one consumer normally, i say normally because there're cases of redelivery or rekeeving whether it's failure or it's not a message, on the successful case each message is deliveried to one consumer only. on the produce side, you can have any number of producers sending messages into an exchange and the sending those messaging a little tuck called a routing key

and the routing key that is used to decide how the messages get into the queue eventually.

 

so there's verbose you do in amqp protocol when you bind a queue to an exchange and you binded it with an pattern.

 

now, it's all about the abstract and the reason the abstract because each exchange has different way of matching pattern of routing keys together, there are defined exchange types in amqp [aspect], the [guven] how a binding key and routing key matched those together.

 

so the two most important exchange types. the direct exchange type and the topic exchange type, with direct ,the binding pattern is just simply the queue name ,and this is the kind of how you can approch normal jms style queue [simontics], you send the message with the queue name, you bind the queue the direct exchange with its own name and everything is just close throught directly to the queue, you always go throught the exchange.

 

with topic exchanges, you're doing the basic of pattern, so you can bind you know ibm.*, vmware.*, vmware.sendside, you can get those kind of routing pattern, one important thing to understand that can alway confuses people from the Java world topic exchange do not imply pub-sub delivery, they are not like topics in JMS, so the topic in JMS you can connect multiply subscribers to the topic and each subscriber still gets one copy of each message. that's not the same as topic exchange.

 

exchanges are purely about routing message to queues, to get pub-sub [] ,eache subscribe need to have his own queue attached to the exchange

 

that's light, that's almost light. so let's now doing some codes.

 

this is microphone...yes

 

so I want to start very quickly by showing you what amqp looks like when it started, so I just running here in normal kind of inprocess mode, you can running detached obviously product usage, well, here is running in my console, and i can find out what [] use the command line client, rabbitmq controll , execute me just very quick echo about what's running and interesting the rabbit plugin module, so i can see what plugin is runining, so i've got management plugin, and i've got the stomp plugin working, so we can use the stomp, er, client as well, this is little low about level,so it's very nice ,we can see here, so,  nothing exciting happing here, no messages, no queues, no consumes...

 

......

 

It's different [om] here,no one can see from here, but [op] there [], there is lone Apple Mac, just sat there on its own, it's like some air Steve Jobs looking down on me, disproving my [usage] of computers. he, right, here we go , so...

 

(待补完)

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics