public class EmbeddedActiveMQBroker extends org.junit.rules.ExternalResource
| Constructor and Description |
|---|
EmbeddedActiveMQBroker()
Create an embedded ActiveMQ broker using defaults
The defaults are:
- the broker name is 'embedded-broker'
- JMX is enabled but no management connector will be created.
|
EmbeddedActiveMQBroker(String configurationURI)
Create an embedded ActiveMQ broker using a configuration URI
|
EmbeddedActiveMQBroker(URI configurationURI)
Create an embedded ActiveMQ broker using a configuration URI
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
after()
Stop the embedded ActiveMQ Broker
Invoked by JUnit to tear down the resource
|
protected void |
before()
Start the embedded ActiveMQ Broker
Invoked by JUnit to setup the resource
|
protected void |
configure()
Customize the configuration of the embedded ActiveMQ broker
This method is called before the embedded ActiveMQ broker is started, and can
be overridden to this method to customize the broker configuration.
|
org.apache.activemq.ActiveMQConnectionFactory |
createConnectionFactory()
Create an ActiveMQConnectionFactory for the embedded ActiveMQ Broker
|
PooledConnectionFactory |
createPooledConnectionFactory()
Create an PooledConnectionFactory for the embedded ActiveMQ Broker
|
void |
disableAdvisoryForConsumed() |
void |
disableAdvisoryForDelivery() |
void |
disableAdvisoryForDiscardingMessages() |
void |
disableAdvisoryForFastProducers() |
void |
disableAdvisoryForSlowConsumers() |
void |
disableStatisticsPlugin() |
void |
enableAdvisoryForConsumed() |
void |
enableAdvisoryForDelivery() |
void |
enableAdvisoryForDiscardingMessages() |
void |
enableAdvisoryForFastProducers() |
void |
enableAdvisoryForSlowConsumers() |
void |
enableStatisticsPlugin() |
String |
getBrokerName()
Get the name of the embedded ActiveMQ Broker
|
BrokerService |
getBrokerService()
Get the BrokerService for the embedded ActiveMQ broker.
|
int |
getMessageCount(String fullDestinationName)
Get the number of messages in a specific JMS Destination.
|
String |
getVmURL()
Get the VM URL for the embedded ActiveMQ Broker
NOTE: The option is precreate=false option is appended to the URL to avoid the automatic creation of brokers
and the resulting duplicate broker errors
|
boolean |
isAdvisoryForConsumedEnabled() |
boolean |
isAdvisoryForDeliveryEnabled() |
boolean |
isAdvisoryForDiscardingMessagesEnabled() |
boolean |
isAdvisoryForFastProducersEnabled() |
boolean |
isAdvisoryForSlowConsumersEnabled() |
boolean |
isStatisticsPluginEnabled() |
void |
setBrokerName(String brokerName) |
void |
start()
Start the embedded ActiveMQ broker, blocking until the broker has successfully started.
|
void |
stop()
Stop the embedded ActiveMQ broker, blocking until the broker has stopped.
|
applypublic EmbeddedActiveMQBroker()
public EmbeddedActiveMQBroker(String configurationURI)
public EmbeddedActiveMQBroker(URI configurationURI)
protected void configure()
public void start()
public void stop()
protected void before() throws Throwable
before in class org.junit.rules.ExternalResourceThrowableprotected void after()
after in class org.junit.rules.ExternalResourcepublic org.apache.activemq.ActiveMQConnectionFactory createConnectionFactory()
public PooledConnectionFactory createPooledConnectionFactory()
public BrokerService getBrokerService()
public String getVmURL()
public String getBrokerName()
public void setBrokerName(String brokerName)
public boolean isStatisticsPluginEnabled()
public void enableStatisticsPlugin()
public void disableStatisticsPlugin()
public boolean isAdvisoryForDeliveryEnabled()
public void enableAdvisoryForDelivery()
public void disableAdvisoryForDelivery()
public boolean isAdvisoryForConsumedEnabled()
public void enableAdvisoryForConsumed()
public void disableAdvisoryForConsumed()
public boolean isAdvisoryForDiscardingMessagesEnabled()
public void enableAdvisoryForDiscardingMessages()
public void disableAdvisoryForDiscardingMessages()
public boolean isAdvisoryForFastProducersEnabled()
public void enableAdvisoryForFastProducers()
public void disableAdvisoryForFastProducers()
public boolean isAdvisoryForSlowConsumersEnabled()
public void enableAdvisoryForSlowConsumers()
public void disableAdvisoryForSlowConsumers()
public int getMessageCount(String fullDestinationName) throws Exception
fullDestinationName - the full name of the JMS DestinationExceptionCopyright © 2005–2017 The Apache Software Foundation. All rights reserved.