Class QpidEmbeddedBroker

java.lang.Object
fr.ght1pc9kc.testy.beat.brokers.QpidEmbeddedBroker
All Implemented Interfaces:
EmbeddedBroker

public final class QpidEmbeddedBroker extends Object implements EmbeddedBroker
Class wrapping an embedded AMQP broker provided by Apache QPID.
  • Field Details

  • 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 interface EmbeddedBroker
    • newConnection

      public com.rabbitmq.client.Connection newConnection()
      Open a new connection on the broker.
      Specified by:
      newConnection in interface EmbeddedBroker
      Returns:
      The opened connection.
    • stop

      public void stop()
      Stop the AMQP broker.
      Specified by:
      stop in interface EmbeddedBroker
    • getConnectionFactory

      public com.rabbitmq.client.ConnectionFactory getConnectionFactory()
      Description copied from interface: EmbeddedBroker
      Obtain the connection factory.
      Specified by:
      getConnectionFactory in interface EmbeddedBroker
      Returns:
      Connection factory for the broker.