public class RabbitSource extends AbstractModuleFixture<RabbitSource>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_EXCHANGE |
static java.lang.String |
DEFAULT_QUEUE |
label
Constructor and Description |
---|
RabbitSource(org.springframework.amqp.rabbit.connection.CachingConnectionFactory connectionFactory,
java.lang.String queue)
Initialize and instance of the RabbitSource
|
Modifier and Type | Method and Description |
---|---|
void |
createQueue()
Creates an instance of the queue on the rabbit broker.
|
void |
destroyQueue()
Creates an instance of the queue on the rabbit broker.
|
RabbitSource |
ensureReady()
Ensure that the Rabbit broker socket is available by polling it for up to 2 seconds
|
RabbitSource |
queue(java.lang.String queue)
Sets the queue for this fixture.
|
void |
sendData(java.lang.String data)
Sends data to the RabbitMQ Broker.
|
protected java.lang.String |
toDSL()
Renders the DSL for this fixture.
|
static RabbitSource |
withDefaults(org.springframework.amqp.rabbit.connection.CachingConnectionFactory connectionFactory)
Creates an instance of the Rabbit Source using defaults
|
label, toString
public static final java.lang.String DEFAULT_QUEUE
public static final java.lang.String DEFAULT_EXCHANGE
public RabbitSource(org.springframework.amqp.rabbit.connection.CachingConnectionFactory connectionFactory, java.lang.String queue)
connectionFactory
- The MQ Connection Factory to be used by the Rabbit Source.queue
- The queue to be monitored by the source.protected java.lang.String toDSL()
toDSL
in class AbstractModuleFixture<RabbitSource>
public static RabbitSource withDefaults(org.springframework.amqp.rabbit.connection.CachingConnectionFactory connectionFactory)
connectionFactory
- the MQ Connection Factory for this source.public RabbitSource ensureReady()
java.lang.IllegalStateException
- if can not connect in 2 seconds.public void createQueue()
public void destroyQueue()
public void sendData(java.lang.String data)
data
- String to be transmitted to the Broker.public RabbitSource queue(java.lang.String queue)
queue
- the name of the queue to be associated with this source.