Package org.apache.activemq.openwire

Examples of org.apache.activemq.openwire.OpenWireFormat


        return new CommandJoiner(transport, wireFormat);
    }

    protected Transport createConsumer() throws Exception {
        log.info("Consumer on port: " + consumerPort);
        OpenWireFormat wireFormat = createWireFormat();
        UdpTransport transport = new UdpTransport(wireFormat, consumerPort);
        transport.setSequenceGenerator(new IntSequenceGenerator());
        return new CommandJoiner(transport, wireFormat);
    }
View Full Code Here


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

    protected OpenWireFormat createWireFormat() {
        return new OpenWireFormat();
    }
View Full Code Here

    };

    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

        return new CommandJoiner(reliableTransport, wireFormat);
    }

    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

     * @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

        wireFormat = createWireFormat();
        super.setUp();
    }
   
    protected WireFormat createWireFormat() {
        OpenWireFormat answer = new OpenWireFormat();
        answer.setCacheEnabled(cacheEnabled);
        return answer;
    }
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

    public WireFormat wireFormat = new OpenWireFormat();
   
    public void initCombos() {
     
      OpenWireFormat wf1 = new OpenWireFormat();
      wf1.setCacheEnabled(false);
      OpenWireFormat wf2 = new OpenWireFormat();
      wf2.setCacheEnabled(true);
     
        addCombinationValues( "wireFormat", new Object[]{
                wf1,
                wf2,
                });       
View Full Code Here

    private static final Log LOG = LogFactory.getLog(JDBCStoreOrderTest.class);
   
    @Override
     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();
        while(result.next()) {
            long id = result.getLong(1);
            Message message = (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

            if (options.containsKey("port")) {
                throw new IllegalArgumentException("The port property cannot be specified on a UDP server transport - please use the port in the URI syntax");
            }
            WireFormat wf = createWireFormat(options);
            int port = location.getPort();
            OpenWireFormat openWireFormat = asOpenWireFormat(wf);
            UdpTransport transport = (UdpTransport) createTransport(location, wf);

            Transport configuredTransport = configure(transport, wf, options, true);
            UdpTransportServer server = new UdpTransportServer(location, transport, configuredTransport, createReplayStrategy());
            return server;
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.