Search code examples
hivemq

How to expose the HiveMQ Plugin functionality to outside?


I have a hive mq broker installed and a plugin in residing inside the broker. Let us just say the plugin has the ability to fetch the topics a user is subscribed to given a user id. Suppose if a end user wants to know the topics he is subscribed to, one way to do it is he will publish a message to a predefined topic that the plugin will listen to and then fetch the list of topics and then publish the list back to the user. I want to know is there any other way (Http comes to mind immediately, but i guess it is not feasible in Hive MQ plugin) to expose the data outside the plugin ?

Posted the same question here


Solution

  • I alreay answered the question on the support forum. Here are the relevant parts of my answer:

    I would suggest embedding a HTTP Server / Servlet Container (like Jetty) directly in the plugin. Integrating this should be pretty straightforward, the only thing you should take care of is how you integrate the needed services (like SubscriptionService) to your JAX-RS resources / Servlets. You certainly can’t use JAX-RS 2 dependency injection smoothly together with HiveMQ internals, but if you don’t do anything fancy that shouldn’t be a problem

    You can find more details here on Google Groups.