Is it possible to use ActiveMQ for publish/subscribe messaging - activemq

I am very much new to activemq. I was trying to use activemq broker for subscribe/publish messages. But as for lack of experience I have no idea how to do it or if its really possible to do it. I googled a lot but unfortunately there is no suitable example for this type of functionality. So I was hoping may be someone here can put some light on it. Can any one here can give me some example of how to do it? or may be some link to online documentation. I have already tried apache activemq broker documentation. But it was not helpful, or may be I dont have that much experience to take help from it.

What you are interested in is done using topics. The reason that you haven't necessarily seen a description of it on the ActiveMQ site is that it's a foundational thing that is assumed that readers know about.
If you are looking at an introduction into messaging using Java, the best place is Oracle's JMS tutorial. Afterwards take a look at the code in the examples directory of an ActiveMQ installation. Alternatively, ActiveMQ in Action is a great book to get you heading in the right direction.
If you are using a language other than Java, ActiveMQ supports the STOMP protocol for which there are a large number of implementations in various languages.
Hope that helps.

Related

RabbitMq generate automatic schematics

does anyone knows if there is a way to get RabbitMq Schematics?
If you read the tutorials there are some schematics like this one:
I was wondering if i can get same schematics (automated) for my architectures.
Thank you!
This tool may be useful. If you search using the terms rabbitmq visualizer you may find other tools.
Some of my colleagues on the RabbitMQ engineering team suggested Inkscape and Dia. The diagram to which you link was created my CloudAMQP (I think) and we re-use it with permission.
NOTE: the RabbitMQ team monitors the rabbitmq-users mailing list and only sometimes answers questions on StackOverflow.

Migrating from IBM MQ to RabbitMQ

Can we migrate from IBM MQ to Rabbit MQ ? Is this possible?
Are there any dependencies.What are the factors that we need to look at.
That's like asking can you migrate from Java to c++. Both things do the same thing but are different by structure (at least).
You can do it of course, but I wouldn't call it migrating, but setting up new. They are both message queue brokers and you could keep some concepts (architecturally looking) but the whole "physical" infrastructure would needed to be set up from scratch.
You need to re-look at the current messaging design pattern and re-design it for RabbitMQ. And design the roll-out strategy. Secondly all the producers and consumers need to be re-written. You need to take into consideration how much effort the producer and consumer applications need to migrate to the new messaging system and secondly Messaging Format also slightly different here in RabbitMQ. So you need to take various aspect into consideration before migrating.

Simple example of Masstransit with RabbitMQ

I want to use MassTransit bus with RabbitMQ. But I am not able to find a simple example. I am looking for example which will get me started.
What I have tried.
googled: But most the examples are using MSMQ or they using too many configuration options.
GitHub: I looked a the GitHub for MassTransit (https://github.com/MassTransit/MassTransit/tree/master/src/Samples) But the example here is heavily loaded. It's very hard to understand for beginners.
Reading docs: I have started reading docs but it will take some time before I finish it. I am hoping if someone shares a link to simple example which will get me started.
Please provide your suggestion.
Here's a simple, good pub-sub example using MassTransit and RabbitMQ both.
http://looselycoupledlabs.com/2014/06/masstransit-publish-subscribe-example/
In case the article link does not work, here's the link to the source code:
https://github.com/dprothero/MtPubSubExample
Thanks to the author of course!
MassTransit implements a lot of concepts and provides great many features with a very small surface API. There's no simple way to describe everything it does, because the problems it helps to solve are not simple, but an example can be made small.
Have a look at this sample I have for testing throughput:
https://github.com/et1975/Throughput-Test
The only "extra" that one might find unnecessary is Dependency Injection integration. You'd want one in most cases, but it does hide how certain bits interact.
Look at https://groups.google.com/forum/?fromgroups#!forum/masstransit-discuss for more help.
Cheers,
ET.

'Queueing' tutorials and documentation?

I'm looking for articles and references that give an overview of 'queueing' (I'm probably not even using the right term here). I'm hoping for an introductory styled guide through a world of Redis, RabbitMQ, Celery, Kombu, and whatever other components exist that I haven't read about yet, and how they fit together.
My problem is I need to queue up background tasks for issued by my Django website, and every blog and article I read recommend different solutions.
Lots of options available to you, and your choice will likely come down to personal preference and what dependencies you feel comfortable installing.
I'll give a vote for Redis. I evaluated RabbitMQ, ActiveMQ, HornetQ, and Redis and found Redis to offer the best mix of ease of installation, simplicity, and performance.
It's technically not a message queue, but the push/pop primitives for the list types provide atomic queue-like operations, so it can effectively be used as a queue. It has worked well for us.
One python specific project on top of Redis you might look at:
http://richardhenry.github.com/hotqueue/tutorial.html
Very simple. But again, all the other options, like Celery, are viable too.
RabbitMQ has a good introduction here: http://www.rabbitmq.com/getstarted.html There's examples in Python, even.
HornetQ has a very good documentation, and it's simple to install.
You can find the documentation at www.hornetq.org, and you would have several examples available with the distribution.

Serializing objects for asynchronous messaging

I'm considering using AMQP (using qpid) to enable a mixture of Python and Java services communicate with each other. Basic text messaging seems simple enough but, as with every other messaging technology I've investigated, that's where it seems to stop. Except for building instant messaging applications, I would have thought sending strings wasn't a particularly useful thing to do yet example after example demonstrates sending unformatted text around.
My instinct then is to use XML (de-)serialization or something similar (JSON, YAML, Protocol Buffers etc.) which has good library support in both languages. Is this a best practice and, if so, which (de-)serialization protocol would people recommend? Or am I missing the point somewhere and should be quite content sending small bits of text?
Owen, may I offer a few words about RabbitMQ.
AMQP is a binary protocol and you can certainly do much more than send strings around! Which Python client do you plan to use? We recommend Barry Pederson's client for most uses: http://barryp.org/software/py-amqplib/ You are most welcome to come to the RabbitMQ list and ask any questions you like about anything in relation to your post and the comments :-)
As James points out, JSON is goodness. RabbitMQ supports JSON-RPC over HTTP connecting to an AMQP back end. People also use RabbitMQ with Orbited for comet type apps.
In addition we are fans of, and support XMPP, and STOMP too which James invented. STOMP is handy for a certain class of messaging apps and RabbitMQ supports it for both direct and topic based routing. We've found it a fine way to interop with ActiveMQ, preferring it to JMS in that scenario.
I hope you find the right server for your use cases, and recommend you try out different combinations, for best results.
Cheers,
alexis
For what it's worth, I've been having a good experience using AMQP + Protocol Buffers.
If the sender is serializing the messages, you will probably need to include an id in the header so that you know how to de-serialize on the receiving side. However, this isn't too much trouble to accomplish.
XML or JSON are probably the easiest. Protocol buffers is cool but I'd treat it as an optimisation to think of later on if you really need to (as its a bit harder to use being essentially a binary wire format).
BTW you might want to look at Stomp rather than AMQP; its got way more client libraries and supported message brokers. e.g. Apache ActiveMQ which is way more popular than qpid or rabbitmq - or indeed any JMS provider would work just fine.