Package org.apache.activemq.openwire

Examples of org.apache.activemq.openwire.OpenWireFormat


    }

    @Override
    protected Transport createConsumer() throws Exception {
        LOG.info("Consumer on port: " + consumerPort);
        OpenWireFormat wireFormat = createWireFormat();
        UdpTransport transport = new UdpTransport(wireFormat, consumerPort);

        ReliableTransport reliableTransport = new ReliableTransport(transport, transport);
        Replayer replayer = reliableTransport.getReplayer();
        reliableTransport.setReplayStrategy(createReplayStrategy(replayer));
View Full Code Here


        broker.stop();
    }

     protected void dumpMessages() throws Exception {
        WireFormat wireFormat = new OpenWireFormat();
        java.sql.Connection conn = ((JDBCPersistenceAdapter) broker.getPersistenceAdapter()).getDataSource().getConnection();
        PreparedStatement statement = conn.prepareStatement("SELECT ID, MSG FROM ACTIVEMQ_MSGS");   
        ResultSet result = statement.executeQuery();
        LOG.info("Messages left in broker after test");
        while(result.next()) {
            long id = result.getLong(1);
            org.apache.activemq.command.Message message = (org.apache.activemq.command.Message)wireFormat.unmarshal(new ByteSequence(result.getBytes(2)));
            LOG.info("id: " + id + ", message SeqId: " + message.getMessageId().getBrokerSequenceId() + ", MSG: " + message);
        }
        statement.close();
        conn.close();
    }
View Full Code Here

     * @throws IOException
     */
    public FilePendingMessageCursor(String name,Store store){
        try{
            list=store.getListContainer(name);
            list.setMarshaller(new CommandMarshaller(new OpenWireFormat()));
            list.setMaximumCacheSize(0);
        }catch(IOException e){
            throw new RuntimeException(e);
        }
    }
View Full Code Here

        msg.setProperty("floatProperty", Float.valueOf("1.1f"));
        msg.setProperty("doubleProperty", Double.valueOf("1.1"));
        msg.setProperty("booleanProperty", Boolean.TRUE);
        msg.setProperty("nullProperty", null);

        msg.beforeMarshall(new OpenWireFormat());

        Map<String, Object> properties = msg.getProperties();
        assertEquals(properties.get("stringProperty"), "string");
        assertEquals(((Byte) properties.get("byteProperty")).byteValue(), 1);
        assertEquals(((Short) properties.get("shortProperty")).shortValue(), 1);
View Full Code Here

    @Override
    protected Transport createProducer() throws Exception {
        LOG.info("Producer using URI: " + producerURI);

        OpenWireFormat wireFormat = createWireFormat();
        UnreliableUdpTransport transport = new UnreliableUdpTransport(wireFormat, new URI(producerURI));
        transport.setDropCommandStrategy(dropStrategy);

        ReliableTransport reliableTransport = new ReliableTransport(transport, transport);
        Replayer replayer = reliableTransport.getReplayer();
View Full Code Here

    }

    @Override
    protected Transport createConsumer() throws Exception {
        LOG.info("Consumer on port: " + consumerPort);
        OpenWireFormat wireFormat = createWireFormat();
        UdpTransport transport = new UdpTransport(wireFormat, consumerPort);

        ReliableTransport reliableTransport = new ReliableTransport(transport, transport);
        Replayer replayer = reliableTransport.getReplayer();
        reliableTransport.setReplayStrategy(createReplayStrategy(replayer));
View Full Code Here

       
        // we are not using the TransportFactory as this assumes that
        // transports talk to a server using a WireFormat Negotiation step
        // rather than talking directly to each other
       
        OpenWireFormat wireFormat = createWireFormat();
        MulticastTransport transport = new MulticastTransport(wireFormat, new URI(multicastURI));
        transport.setLoopBackMode(false);
        transport.setSequenceGenerator(new IntSequenceGenerator());
        return new CommandJoiner(transport, wireFormat);
    }
View Full Code Here

        transport.setSequenceGenerator(new IntSequenceGenerator());
        return new CommandJoiner(transport, wireFormat);
    }

    protected Transport createConsumer() throws Exception {
        OpenWireFormat wireFormat = createWireFormat();
        MulticastTransport transport = new MulticastTransport(wireFormat, new URI(multicastURI));
        transport.setLoopBackMode(false);
        transport.setSequenceGenerator(new IntSequenceGenerator());
        return new CommandJoiner(transport, wireFormat);
    }
View Full Code Here

        msg.setProperty("floatProperty", Float.valueOf("1.1f"));
        msg.setProperty("doubleProperty", Double.valueOf("1.1"));
        msg.setProperty("booleanProperty", Boolean.TRUE);
        msg.setProperty("nullProperty", null);

        msg.beforeMarshall(new OpenWireFormat());

        Map properties = msg.getProperties();
        assertEquals(properties.get("stringProperty"), "string");
        assertEquals(((Byte)properties.get("byteProperty")).byteValue(), 1);
        assertEquals(((Short)properties.get("shortProperty")).shortValue(), 1);
View Full Code Here

        //
        // Manually create a client transport so that it does not send KeepAlive
        // packets.
        // this should simulate a client hang.
        clientTransport = new TcpTransport(new OpenWireFormat(), SocketFactory.getDefault(), new URI("tcp://localhost:61616"), null);
        clientTransport.setTransportListener(new TransportListener() {
            public void onCommand(Object command) {
                clientReceiveCount.incrementAndGet();
                if (clientRunOnCommand != null) {
                    clientRunOnCommand.run();
View Full Code Here

TOP

Related Classes of org.apache.activemq.openwire.OpenWireFormat

Copyright © 2018 www.massapicom. 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.