public void open(String host, int port) throws IOException, UnknownHostException { open(new Socket(host, port)); }
public void open(String host, int port) throws IOException, UnknownHostException { open(new Socket(host, port)); }
public void open(String host, int port) throws IOException, UnknownHostException { open(new Socket(host, port)); }
public void open(String host, int port) throws IOException, UnknownHostException { open(new Socket(host, port)); }
System.setProperty("javax.net.ssl.keyStore", "/home/foo/.keystore/client.ks"); System.setProperty("javax.net.ssl.keyStorePassword", "changeme"); System.setProperty("javax.net.ssl.trustStore", "/home/foo/.keystore/client.ts"); StompConnection connection = new StompConnection(); SSLSocketFactory factory = (SSLSocketFactory) SSLSocketFactory .getDefault(); SSLSocket sslsocket = (SSLSocket) factory.createSocket("127.0.0.1", 61612); connection.open(sslsocket);
StompConnection connection = new StompConnection(); connection.open("localhost", 61613); connection.connect("system", "manager"); StompFrame connect = connection.receive(); if (!connect.getAction().equals(Stomp.Responses.CONNECTED)) { throw new Exception ("Not connected"); } connection.begin("tx1"); connection.send("/queue/test", "message1", "tx1", null); connection.send("/queue/test", "message2", "tx1", null); connection.commit("tx1"); connection.subscribe("/queue/test", Subscribe.AckModeValues.CLIENT); connection.begin("tx2"); StompFrame message = connection.receive(); System.out.println(message.getBody()); connection.ack(message, "tx2"); message = connection.receive(); System.out.println(message.getBody()); connection.ack(message, "tx2"); connection.commit("tx2"); connection.disconnect();