The problem you've described is pretty vague and open-ended in my opinion.
It's hard to give any advice in such a situation, but here's a thought...

You could have register() return the javax.jms.MessageConsumer on which the
message listener is set so when you want to close it you can just call
MessageConsumer.close().


Justin

On Fri, Aug 18, 2017 at 12:26 PM, Juleian <julian.herb...@gmx.net> wrote:

> We want to use ActiveMQ within a tool for JMS communication. I wrote a
> class
> containing a method that handles the subscription to the broker with a
> certain topic. So by using my register(topic) method, a message listener is
> created that listens to the topic mentioned in the parameter. This register
> mehtod will be used by java classes within our tool. Now I need to be able
> to close those message listeners when the component (java class) wants to.
> But I dont see a way by now, how to implement a "unsubscribe" method.
>
> So in a nutshell, I want a java class to be able to call register(test);
> and
> when it does not want to receiver messages anymore, call
> unsubscribe(parameter necessary?) to close the session. How can I adress
> the
> ceated session and close it within my java class?
>
> Can somebody help me?
>
>
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.
> nabble.com/Close-message-listener-decoupled-tp4729814.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Reply via email to