Micronaut-core: JMS Application Support

Created on 28 Feb 2019  路  11Comments  路  Source: micronaut-projects/micronaut-core

Currently Kafka and RabbitMQ / AMQP are supported as messaging formats. It would be nice however if micronaut would also support JMS in the same way it supports Kafka and RabbitMQ.

under consideration enhancement

Most helpful comment

@graemerocher it seems like this is a quite large feature but would be super useful. Would you suggest incorporating an implementation of JMS in micronaut-core or as a separate affiliate project (like micronaut-rabbitmq and micronaut-kafka)? It seems to me that this can be broken up into many smaller parts as well. My thinking is as follows:

  1. Implement JMSProducer and JMSConsumer classes as a wrap around the boilerplate JMS code to do synchronous send and receive functions while abstracting away the Connection, Session, and Message objects. These would just be boilerplate code and would mostly be the same as the spring-jms JmsTemplate and SimpleMessageConverter implementations
  2. Implement JMSListener classes to do the asynchronous message receipt and handle the a thread pool to execute tasks on.
  3. Link up some convenience annotations @MessageListener and @MessageProducer for classes following a particular pattern or have particular annotation patterns like the @Queue and @Binding annotations in micronaut-rabbitmq
  4. This is something I'm not certain about how to implement. It would be good to have some form of dynamic registration of JMSListeners as beans both programmatically and through environment variables. Hopefully this is possible without introspection but I am not sure.

All 11 comments

+1
would be interesting in combination with amazon mq etc.
Currently it's not possible to use amazon mq with micronaut like it is with kafka and rabbitmq.

Is it possible to use Sonic JMS with micronaut, either with micronaut libs or using spring-jms?

@graemerocher it seems like this is a quite large feature but would be super useful. Would you suggest incorporating an implementation of JMS in micronaut-core or as a separate affiliate project (like micronaut-rabbitmq and micronaut-kafka)? It seems to me that this can be broken up into many smaller parts as well. My thinking is as follows:

  1. Implement JMSProducer and JMSConsumer classes as a wrap around the boilerplate JMS code to do synchronous send and receive functions while abstracting away the Connection, Session, and Message objects. These would just be boilerplate code and would mostly be the same as the spring-jms JmsTemplate and SimpleMessageConverter implementations
  2. Implement JMSListener classes to do the asynchronous message receipt and handle the a thread pool to execute tasks on.
  3. Link up some convenience annotations @MessageListener and @MessageProducer for classes following a particular pattern or have particular annotation patterns like the @Queue and @Binding annotations in micronaut-rabbitmq
  4. This is something I'm not certain about how to implement. It would be good to have some form of dynamic registration of JMSListeners as beans both programmatically and through environment variables. Hopefully this is possible without introspection but I am not sure.

A micronaut-kms subproject makes the most sense. It can be split into as many modules as makes sense

@graemerocher I have the very beginnings of a hacky micronaut-jms implementation in a private repo on my GitHub. I still need to clean it up and document it thoroughly, but I also wanted to see what I should be doing concerning CI/CD and Licensing? Should this project be covered under the same license as micronaut-core? If so, what steps would I need to take to cover micronaut-jms? Additionally, is there some guidance around setting up a pipeline to build, test, and deploy a new project and associate it to Micronaut?

Hi @elliottpope

Sounds exciting!

We can setup the project within micronaut-projects and it will handle all of the CI / automated release process / etc.

In general all micronaut projects are Apache 2.0 licensed and if it were to be included in micronaut-projects we would request use of that license.

Let me know if you want to proceed with that and I can setup micronaut-jms and I can add you as a collaborator

@graemerocher I think I have the scaffolding for micronaut-jms with some annotation driven listeners and some easily constructed producers. It's definitely still very alpha and isn't ready for anything beyond some example and hobby projects yet but should now be fairly easy to start extending all of the functionality to what the community needs. Let me know what I need to do to get everything rolling.

I will create a repo for it soon and you can send a PR if that works for you ?

That sounds good, thank you

@elliottpope ok here it is https://github.com/micronaut-projects/micronaut-jms go ahead and send a PR to that repo as a starting point.

@rmorrise, I haven't been able to figure out how to introduce the SonicMQ client libraries into the micronaut-jms project. I'm assuming they are proprietary. If I'm wrong, feel free to point me to an example project and I can see what I can do but for now ActiveMQ/AmazonMQ will be the only out of the box implementation. However, as long as the client allows you to define a ConnectionFactory then you'll be able to easily define producers and listeners in code using the following pattern:

@Factory
public class BrokerConfiguration {
   @JMSConnectionFactory("my-connection-factory")
   public ConnectionFactory myConnectionFactory() {
      return new BrokerConnectionFactory();
   }
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

adityasrini picture adityasrini  路  5Comments

gitjxm picture gitjxm  路  3Comments

dchenk picture dchenk  路  3Comments

fabienrenaud picture fabienrenaud  路  5Comments

johanhaleby picture johanhaleby  路  4Comments