This Confluence has been LDAP enabled, if you are an ASF Committer, please use your LDAP Credentials to login. Any problems file an INFRA jira ticket please.

Child pages
  • How do I unack the message with Stomp

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Take a look at the following example:

Note

This feature is works correctly since 5.3 version

Code Block
StompConnection connection = new StompConnection();
connection.open("localhost", 61613);
		
connection.connect("system", "manager");
		
connection.send("/queue/test", "message 1");
connection.send("/queue/test", "message 2");
connection.send("/queue/test", "message 3");
		
HashMap<String, String> headers = new HashMap<String, String>();
headers.put("activemq.prefetchSize", "1");
connection.subscribe("/queue/test", "client", headers);
		
connection.begin("tx1");
StompFrame frame = connection.receive();
System.out.println(frame.getBody());
connection.ack(frame, "tx1");
connection.abort("tx1");
		
connection.begin("tx2");
connection.ack(frame, "tx2");        //sending the ack again
frame = connection.receive();
System.out.println(frame.getBody());
connection.ack(frame, "tx2");
connection.commit("tx2");
		
connection.begin("tx3");
frame = connection.receive();
System.out.println(frame.getBody());
connection.ack(frame, "tx3");
connection.commit("tx3");

...