Package fr.ght1pc9kc.testy.beat.brokers
Class QpidEmbeddedBroker
java.lang.Object
fr.ght1pc9kc.testy.beat.brokers.QpidEmbeddedBroker
- All Implemented Interfaces:
EmbeddedBroker
Class wrapping an embedded AMQP broker provided by Apache QPID.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDefault constructor for the broker.QpidEmbeddedBroker
(String configurationFile, String host, int port, String username, String password) Create a customized broker. -
Method Summary
-
Field Details
-
DEFAULT_HOST
- See Also:
-
DEFAULT_PORT
public static final int DEFAULT_PORT- See Also:
-
DEFAULT_USERNAME
- See Also:
-
DEFAULT_PASS
- See Also:
-
-
Constructor Details
-
QpidEmbeddedBroker
public QpidEmbeddedBroker()Default constructor for the broker. By default the values are:- Configuration file: embedded-broker.json (provided by Testy-beat-box)
- Host: localhost
- Port: 9595
- Username: obiwan
-
QpidEmbeddedBroker
public QpidEmbeddedBroker(String configurationFile, String host, int port, String username, String password) Create a customized broker.- Parameters:
configurationFile
- The path to the configuration file of the broker.host
- The host running the broker.port
- The port to access to a connection.username
- Username to get a connection.password
- Password to get a connection.
-
-
Method Details
-
start
public void start()Start the embedded AMQP broker.- Specified by:
start
in interfaceEmbeddedBroker
-
newConnection
public com.rabbitmq.client.Connection newConnection()Open a new connection on the broker.- Specified by:
newConnection
in interfaceEmbeddedBroker
- Returns:
- The opened connection.
-
stop
public void stop()Stop the AMQP broker.- Specified by:
stop
in interfaceEmbeddedBroker
-
getConnectionFactory
public com.rabbitmq.client.ConnectionFactory getConnectionFactory()Description copied from interface:EmbeddedBroker
Obtain the connection factory.- Specified by:
getConnectionFactory
in interfaceEmbeddedBroker
- Returns:
- Connection factory for the broker.
-