org.apache.qpid.example.transport
Class ExistingSocketConnectorDemo
java.lang.Object
org.apache.qpid.example.transport.ExistingSocketConnectorDemo
- All Implemented Interfaces:
- org.apache.qpid.jms.ConnectionListener
public class ExistingSocketConnectorDemo
- extends Object
- implements org.apache.qpid.jms.ConnectionListener
This is a simple application that demonstrates how you can use the Qpid AMQP interfaces to use existing sockets as
the transport for the Client API.
The Demo here runs twice:
1. Just to show a simple publish and receive.
2. To demonstrate how to use existing sockets and utilise the underlying client failover mechnaism.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_connection
Connection _connection
_producer
MessageProducer _producer
_session
Session _session
Socket1_ID
String Socket1_ID
Socket2_ID
String Socket2_ID
CONNECTION
public final String CONNECTION
- Here we can see the broker we are connecting to is set to be 'socket:///' signifying we will provide the socket.
ExistingSocketConnectorDemo
public ExistingSocketConnectorDemo()
throws IOException,
org.apache.qpid.url.URLSyntaxException,
org.apache.qpid.AMQException,
JMSException
- Throws:
IOException
org.apache.qpid.url.URLSyntaxException
org.apache.qpid.AMQException
JMSException
main
public static void main(String[] args)
throws IOException,
org.apache.qpid.url.URLSyntaxException,
org.apache.qpid.AMQException,
JMSException
- Throws:
IOException
org.apache.qpid.url.URLSyntaxException
org.apache.qpid.AMQException
JMSException
bytesSent
public void bytesSent(long count)
- Specified by:
bytesSent
in interface org.apache.qpid.jms.ConnectionListener
bytesReceived
public void bytesReceived(long count)
- Specified by:
bytesReceived
in interface org.apache.qpid.jms.ConnectionListener
preFailover
public boolean preFailover(boolean redirect)
- Specified by:
preFailover
in interface org.apache.qpid.jms.ConnectionListener
preResubscribe
public boolean preResubscribe()
- Specified by:
preResubscribe
in interface org.apache.qpid.jms.ConnectionListener
failoverComplete
public void failoverComplete()
- Specified by:
failoverComplete
in interface org.apache.qpid.jms.ConnectionListener
Licensed to the Apache Software Foundation