You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by 刘焕 <li...@126.com> on 2015/04/20 03:46:59 UTC

how to unsubscribe a frame using apache apollo?

I want to send a stomp frame in order to unsubscribe a certain topic. By reading documents, I find it possible via sending a "UNSUBSCRIBE"stomp frame ,but I don't how to achieve it  by programming in JAVA.What should I do?
Thank you!


(I'm a Chinese.So,I am not good at English.)

Re: how to unsubscribe a frame using apache apollo?

Posted by "Jamie G." <ja...@gmail.com>.
Here's a brief sample code:

Stomp stomp = new Stomp("localhost", 61613);

Future<FutureConnection> future = stomp.connectFuture();

FutureConnection connection = future.await();

AsciiBuffer id = connection.nextId();

StompFrame unsubscribe = new StompFrame(UNSUBSCRIBE);

unsubscribe.addHeader(ID, id);

Future<Void> unsubscribeFuture = connection.send(unsubscribe);

unsubscribeFuture.await();


It might be missing some steps - but should contain most of the basics.

Cheers,
Jamie

On Sun, Apr 19, 2015 at 11:16 PM, 刘焕 <li...@126.com> wrote:
> I want to send a stomp frame in order to unsubscribe a certain topic. By reading documents, I find it possible via sending a "UNSUBSCRIBE"stomp frame ,but I don't how to achieve it  by programming in JAVA.What should I do?
> Thank you!
>
>
> (I'm a Chinese.So,I am not good at English.)

Re: how to unsubscribe a frame using apache apollo?

Posted by "Jamie G." <ja...@gmail.com>.
Here's a brief sample code:

Stomp stomp = new Stomp("localhost", 61613);

Future<FutureConnection> future = stomp.connectFuture();

FutureConnection connection = future.await();

AsciiBuffer id = connection.nextId();

StompFrame unsubscribe = new StompFrame(UNSUBSCRIBE);

unsubscribe.addHeader(ID, id);

Future<Void> unsubscribeFuture = connection.send(unsubscribe);

unsubscribeFuture.await();


It might be missing some steps - but should contain most of the basics.

Cheers,
Jamie

On Sun, Apr 19, 2015 at 11:16 PM, 刘焕 <li...@126.com> wrote:
> I want to send a stomp frame in order to unsubscribe a certain topic. By reading documents, I find it possible via sending a "UNSUBSCRIBE"stomp frame ,but I don't how to achieve it  by programming in JAVA.What should I do?
> Thank you!
>
>
> (I'm a Chinese.So,I am not good at English.)