Search in sources :

Example 6 with OpenWireFormat

use of org.apache.activemq.openwire.OpenWireFormat in project activemq-artemis by apache.

the class UnreliableUdpTransportTest method createProducer.

@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();
    reliableTransport.setReplayStrategy(createReplayStrategy(replayer));
    return new CommandJoiner(reliableTransport, wireFormat);
}
Also used : OpenWireFormat(org.apache.activemq.openwire.OpenWireFormat) CommandJoiner(org.apache.activemq.transport.CommandJoiner) URI(java.net.URI)

Example 7 with OpenWireFormat

use of org.apache.activemq.openwire.OpenWireFormat in project activemq-artemis by apache.

the class RecoverExpiredMessagesTest method initCombosForTestRecovery.

public void initCombosForTestRecovery() throws Exception {
    addCombinationValues("queuePendingPolicy", new PendingQueueMessageStoragePolicy[] { new FilePendingQueueMessageStoragePolicy(), new VMPendingQueueMessageStoragePolicy() });
    PersistenceAdapter[] persistenceAdapters = new PersistenceAdapter[] { new KahaDBPersistenceAdapter(), new JDBCPersistenceAdapter(DataSourceServiceSupport.createDataSource(IOHelper.getDefaultDataDirectory()), new OpenWireFormat()) };
    for (PersistenceAdapter adapter : persistenceAdapters) {
        adapter.setDirectory(new File(IOHelper.getDefaultDataDirectory()));
    }
    addCombinationValues("persistenceAdapter", persistenceAdapters);
}
Also used : OpenWireFormat(org.apache.activemq.openwire.OpenWireFormat) JDBCPersistenceAdapter(org.apache.activemq.store.jdbc.JDBCPersistenceAdapter) VMPendingQueueMessageStoragePolicy(org.apache.activemq.broker.region.policy.VMPendingQueueMessageStoragePolicy) FilePendingQueueMessageStoragePolicy(org.apache.activemq.broker.region.policy.FilePendingQueueMessageStoragePolicy) File(java.io.File) JDBCPersistenceAdapter(org.apache.activemq.store.jdbc.JDBCPersistenceAdapter) KahaDBPersistenceAdapter(org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter) PersistenceAdapter(org.apache.activemq.store.PersistenceAdapter) KahaDBPersistenceAdapter(org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter)

Example 8 with OpenWireFormat

use of org.apache.activemq.openwire.OpenWireFormat in project activemq-artemis by apache.

the class UdpTransportTest method createConsumer.

@Override
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);
}
Also used : OpenWireFormat(org.apache.activemq.openwire.OpenWireFormat) IntSequenceGenerator(org.apache.activemq.util.IntSequenceGenerator) CommandJoiner(org.apache.activemq.transport.CommandJoiner)

Example 9 with OpenWireFormat

use of org.apache.activemq.openwire.OpenWireFormat in project activemq-artemis by apache.

the class MarshallingBrokerTest method initCombos.

public void initCombos() {
    OpenWireFormat wf1 = new OpenWireFormat();
    wf1.setCacheEnabled(false);
    OpenWireFormat wf2 = new OpenWireFormat();
    wf2.setCacheEnabled(true);
    addCombinationValues("wireFormat", new Object[] { wf1, wf2 });
}
Also used : OpenWireFormat(org.apache.activemq.openwire.OpenWireFormat)

Example 10 with OpenWireFormat

use of org.apache.activemq.openwire.OpenWireFormat in project activemq-artemis by apache.

the class OpenWireProtocolManager method createConnectionEntry.

@Override
public ConnectionEntry createConnectionEntry(Acceptor acceptorUsed, Connection connection) {
    OpenWireFormat wf = (OpenWireFormat) wireFactory.createWireFormat();
    OpenWireConnection owConn = new OpenWireConnection(connection, server, server.getExecutorFactory().getExecutor(), this, wf);
    owConn.sendHandshake();
    // first we setup ttl to -1
    // then when negotiation, we handle real ttl and delay
    ConnectionEntry entry = new ConnectionEntry(owConn, null, System.currentTimeMillis(), -1);
    owConn.setConnectionEntry(entry);
    return entry;
}
Also used : OpenWireFormat(org.apache.activemq.openwire.OpenWireFormat) ConnectionEntry(org.apache.activemq.artemis.spi.core.protocol.ConnectionEntry)

Aggregations

OpenWireFormat (org.apache.activemq.openwire.OpenWireFormat)14 CommandJoiner (org.apache.activemq.transport.CommandJoiner)6 URI (java.net.URI)5 IntSequenceGenerator (org.apache.activemq.util.IntSequenceGenerator)4 IOException (java.io.IOException)2 File (java.io.File)1 HashMap (java.util.HashMap)1 Message (javax.jms.Message)1 ConnectionEntry (org.apache.activemq.artemis.spi.core.protocol.ConnectionEntry)1 FilePendingQueueMessageStoragePolicy (org.apache.activemq.broker.region.policy.FilePendingQueueMessageStoragePolicy)1 VMPendingQueueMessageStoragePolicy (org.apache.activemq.broker.region.policy.VMPendingQueueMessageStoragePolicy)1 WireFormatInfo (org.apache.activemq.command.WireFormatInfo)1 CommandVisitor (org.apache.activemq.state.CommandVisitor)1 PersistenceAdapter (org.apache.activemq.store.PersistenceAdapter)1 JDBCPersistenceAdapter (org.apache.activemq.store.jdbc.JDBCPersistenceAdapter)1 KahaDBPersistenceAdapter (org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter)1 TransportListener (org.apache.activemq.transport.TransportListener)1 WireFormatNegotiator (org.apache.activemq.transport.WireFormatNegotiator)1 ResponseRedirectInterceptor (org.apache.activemq.transport.udp.ResponseRedirectInterceptor)1 UdpTransport (org.apache.activemq.transport.udp.UdpTransport)1