RabbitMQ based message driven bean in GlassFish

I am creating a system that uses RabbitMQ as the messaging solution for its components. However, I have some old Java EJB code that does high I / O tasks on the GlassFish Application Server as an EJB. I would hate to rewrite this code, so I would like to find a way to communicate with it. I know I can just use the RabbitMQ java client, but I'm not sure how I would work with message throttling, I dont want, say, four tasks running at the same time, which is relatively easy to do with messages beans in GlassFish ...

The only one I came up with is a singleton EJB that starts a timer in PostConstruct and after that the timer goes into blocking the AMQP client receive loop. Then I could just copy the AMQP messages received to the local JMS GlassFish provider and poll them with MDB, but I don't like that because I will need to monitor multiple JMS GlassFish providers to see how things are going, not just check RabbitMQ.

I'm trying to find any information on how to hook up AMQP and JMS, has anyone done anything like this before? Any ideas are appreciated.


source to share

2 answers

Let's put it this way: There is no MDB compliant AMQP connector for GlassFish since writing this.



You cannot connect AMQP and JMS as they are fundamentally different concepts. AMQP is a standard that defines how data looks at the wire and how a broker works, JMS is an api definition.

However, the AMQP broker implementation can provide a JMS api and I believe RabbitMQ already has this functionality.



All Articles