Examples of StompConnection


Examples of org.apache.activemq.transport.stomp.StompConnection

            "d3=queue://test&t3=send&m3=msg4") );
        contentExchange.setRequestContentType( "application/x-www-form-urlencoded; charset=UTF-8" );
        httpClient.send(contentExchange);
        contentExchange.waitForDone();

        StompConnection connection = new StompConnection();
        connection.open(stompUri.getHost(), stompUri.getPort());
        connection.connect("user", "password");
        connection.subscribe( "/queue/test" );

        StompFrame message;
        String allMessageBodies = "";
        try {
            while( true ) {
                message = connection.receive(5000);
                allMessageBodies = allMessageBodies +"\n"+ message.getBody();
            }
        } catch (SocketTimeoutException e) {}

        LOG.debug( "All message bodies : " + allMessageBodies );
View Full Code Here

Examples of org.apache.activemq.transport.stomp.StompConnection

            for (TransportConnector transport : broker.getTransportConnectors()) {
                final URI UriToConnectTo = URISupport.removeQuery(transport.getConnectUri());

                if (UriToConnectTo.getScheme().startsWith("stomp")) {
                    LOG.info("validating alive with connection to: " + UriToConnectTo);
                    StompConnection connection = new StompConnection();
                    connection.open(UriToConnectTo.getHost(), UriToConnectTo.getPort());
                    connection.close();
                    break;
                } else if (UriToConnectTo.getScheme().startsWith("tcp")) {
                    LOG.info("validating alive with connection to: " + UriToConnectTo);
                    ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(UriToConnectTo);
                    Connection connection = connectionFactory.createConnection(secProps.getProperty("activemq.username"),
                            secProps.getProperty("activemq.password"));
                    connection.start();
                    connection.close();
                    break;
                } else {
                    LOG.info("not validating connection to: " + UriToConnectTo);
                }
            }
View Full Code Here

Examples of org.jgroups.client.StompConnection

    protected static final String  draw_dest="/topics/draw-demo";
    protected static final String  clients_dest="/topics/clients";


    public StompDraw(String host, String port) throws Exception {
        stomp_client=new StompConnection(host + ":" + port);
        stomp_client.addListener(this);
    }
View Full Code Here

Examples of org.jgroups.client.StompConnection

   


    public StompChat(String host, int port, String user) {
        stomp_client=new StompConnection(host + ":" + port);
        stomp_client.addListener(this);

        username=user;
        try {
            if(username == null)
View Full Code Here

Examples of org.jgroups.client.StompConnection

    protected static final String  draw_dest="/topics/draw-demo";
    protected static final String  clients_dest="/topics/clients";


    public StompDraw(String host, String port) throws Exception {
        stomp_client=new StompConnection(host + ":" + port);
        stomp_client.addListener(this);
    }
View Full Code Here

Examples of org.jgroups.client.StompConnection

    protected static final String  draw_dest="/topics/draw-demo";
    protected static final String  clients_dest="/topics/clients";


    public StompDraw(String host, String port) throws Exception {
        stomp_client=new StompConnection(host + ":" + port);
        stomp_client.addListener(this);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.