Reputation: 8278
I need to implement a demo system for prove of concept. Basically, the system description can be reduced to 2 modules:
(Note: the modules reside in the same intranet, so I probably want the protocol to be faster than http. I thought of the following options:
Ideally, the system would be (but not limited to) java-based, run on Linux RH and be able to scale linearly.However, the performance is out of the scope for the POC. I was looking at ServiceMix and ActiveMQ. My idea was to implement in java theses modules. The architecture will be message-driven. The modules will communicate over message queue or the service bus.
The 'consumer' sends the requests as messages to the message queue, the 'producer' picks them up by certain subscription topic, processes the requests and posts the response back to the same queue. The 'consumer' that is subscribed on 'response' topic picks the results from the queue. END.
My questions are:
Upvotes: 1
Views: 1137
Reputation: 120858
ActiveMQ with XML messages should be enough, unless your messages are big and lots of them, in which case I would go for protobuf(disclaimer: I used them on the last project).
As a matter of fact I would probably go for some amqp implementation, like Apache Qpid(disclaimer: used that also some time ago) over ActiveMQ. But this is more a personal reason.
The downside of protobuf is that you need some knowledge about them, there are hello worlds all around the web, but once you try to face 'real problems' it does not get too easy. You will also need a maven plugin to build and compile the files, unless you want to do it manually.
ActiveMQ is simply a JMS Provider, and I am sure you already looked at this examples:
On an implementation side, when module1 sends the request you want to be sure that the response will be read by the same module. Temporary queues is what I would suggest. Send the request to some queue (and also the temporary queue name for example that the response is expected to come to); module2 processes the message and sends the response to the temporary queue, where it is read by module1 with a message listener.
Now, you have to delete this temporary queues really fast so that don't pile up, and also check that ActiveMQ provides them with unique names.
In QPID with a simple parameter auto-delete=true, when there are no active listeners the queue is deleted, I have no idea how that is handled in ActiveMQ, but there should be a way.
Just my 0.02$
Upvotes: 1