3
votes

I'm building a system which uses RabbitMQ as a messaging solution for its components. However I've got some legacy EJB Java code which does disk IO-intensive tasks on GlassFish app server as EJB. I would not like to re-write that code, so I would like to find a way to communicate with it. I know I could just use RabbitMQ java client, but I'm not sure how I would deal with message throttling, I don't want more than, say, 4 tasks running at the same time which is comparatively easy to do with message driven beans in GlassFish.

The only thing I came up with is a singleton EJB that starts a timer in PostConstruct and upon that timer enters blocking AMQP client receive loop. I might then just copy AMQP messages received into local GlassFish JMS provider and poll them with MDB, but I don't like this because I would have to monitor several GlassFish JMS providers to find out how things are going, instead of just checking up on RabbitMQ.

I'm struggling to find any information on how to interconnect AMQP and JMS, has anyone been doing anything like that before? Any ideas are appreciated.

2

2 Answers

1
votes

You cant interconnect AMQP and JMS as they are fundamentally different concepts. AMQP is a standard that defines how data looks on the wire and the way a broker should work, JMS is an api definition.

That said, an AMQP broker implementation can provide a JMS api, and I believe RabbitMQ already has this functionality.

0
votes

Let's put it this way: as of time of writing this there's no MDB-compatible AMQP connector for GlassFish.