Search in sources :

Example 6 with DestinationInfo

use of org.apache.activemq.command.DestinationInfo in project activemq-artemis by apache.

the class DestinationInfoTest method createObject.

@Override
public Object createObject() throws Exception {
    DestinationInfo info = new DestinationInfo();
    populateObject(info);
    return info;
}
Also used : DestinationInfo(org.apache.activemq.command.DestinationInfo)

Example 7 with DestinationInfo

use of org.apache.activemq.command.DestinationInfo in project activemq-artemis by apache.

the class DestinationInfoTest method createObject.

@Override
public Object createObject() throws Exception {
    DestinationInfo info = new DestinationInfo();
    populateObject(info);
    return info;
}
Also used : DestinationInfo(org.apache.activemq.command.DestinationInfo)

Example 8 with DestinationInfo

use of org.apache.activemq.command.DestinationInfo in project activemq-artemis by apache.

the class DestinationInfoTest method populateObject.

@Override
protected void populateObject(Object object) throws Exception {
    super.populateObject(object);
    DestinationInfo info = (DestinationInfo) object;
    info.setConnectionId(createConnectionId("ConnectionId:1"));
    info.setDestination(createActiveMQDestination("Destination:2"));
    info.setOperationType((byte) 1);
    info.setTimeout(1);
    {
        BrokerId[] value = new BrokerId[2];
        for (int i = 0; i < 2; i++) {
            value[i] = createBrokerId("BrokerPath:3");
        }
        info.setBrokerPath(value);
    }
}
Also used : DestinationInfo(org.apache.activemq.command.DestinationInfo)

Example 9 with DestinationInfo

use of org.apache.activemq.command.DestinationInfo in project activemq-artemis by apache.

the class DestinationInfoTest method populateObject.

@Override
protected void populateObject(Object object) throws Exception {
    super.populateObject(object);
    DestinationInfo info = (DestinationInfo) object;
    info.setConnectionId(createConnectionId("ConnectionId:1"));
    info.setDestination(createActiveMQDestination("Destination:2"));
    info.setOperationType((byte) 1);
    info.setTimeout(1);
    {
        BrokerId[] value = new BrokerId[2];
        for (int i = 0; i < 2; i++) {
            value[i] = createBrokerId("BrokerPath:3");
        }
        info.setBrokerPath(value);
    }
}
Also used : DestinationInfo(org.apache.activemq.command.DestinationInfo)

Example 10 with DestinationInfo

use of org.apache.activemq.command.DestinationInfo in project activemq-artemis by apache.

the class AdvisoryJmxTest method testCreateDeleteDestinations.

public void testCreateDeleteDestinations() throws Exception {
    JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:1199/jmxrmi");
    JMXConnector connector = JMXConnectorFactory.connect(url, null);
    connector.connect();
    MBeanServerConnection connection = connector.getMBeanServerConnection();
    ObjectName name = new ObjectName("org.apache.activemq:type=Broker,brokerName=localhost");
    BrokerViewMBean brokerMbean = MBeanServerInvocationHandler.newProxyInstance(connection, name, BrokerViewMBean.class, true);
    Connection conn = createConnection();
    Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
    MessageConsumer consumer = sess.createConsumer(sess.createTopic("ActiveMQ.Advisory.Queue"));
    conn.start();
    Destination dest = sess.createQueue("test");
    brokerMbean.addQueue("test");
    ActiveMQMessage msg = (ActiveMQMessage) consumer.receive(1000);
    assertNotNull(msg);
    assertTrue(msg.getDataStructure() instanceof DestinationInfo);
    assertEquals(((DestinationInfo) msg.getDataStructure()).getDestination(), dest);
    assertEquals(((DestinationInfo) msg.getDataStructure()).getOperationType(), 0);
    brokerMbean.removeQueue("test");
    msg = (ActiveMQMessage) consumer.receive(1000);
    assertNotNull(msg);
    assertTrue(msg.getDataStructure() instanceof DestinationInfo);
    assertEquals(((DestinationInfo) msg.getDataStructure()).getDestination(), dest);
    assertEquals(((DestinationInfo) msg.getDataStructure()).getOperationType(), 1);
    brokerMbean.addQueue("test");
    msg = (ActiveMQMessage) consumer.receive(1000);
    assertNotNull(msg);
    assertTrue(msg.getDataStructure() instanceof DestinationInfo);
    assertEquals(((DestinationInfo) msg.getDataStructure()).getDestination(), dest);
    assertEquals(((DestinationInfo) msg.getDataStructure()).getOperationType(), 0);
    assertEquals(((DestinationInfo) msg.getDataStructure()).getOperationType(), 0);
}
Also used : JMXServiceURL(javax.management.remote.JMXServiceURL) BrokerViewMBean(org.apache.activemq.broker.jmx.BrokerViewMBean) Destination(javax.jms.Destination) MessageConsumer(javax.jms.MessageConsumer) DestinationInfo(org.apache.activemq.command.DestinationInfo) JMXConnector(javax.management.remote.JMXConnector) Connection(javax.jms.Connection) MBeanServerConnection(javax.management.MBeanServerConnection) MBeanServerConnection(javax.management.MBeanServerConnection) ObjectName(javax.management.ObjectName) Session(javax.jms.Session) ActiveMQMessage(org.apache.activemq.command.ActiveMQMessage)

Aggregations

DestinationInfo (org.apache.activemq.command.DestinationInfo)27 ActiveMQTopic (org.apache.activemq.command.ActiveMQTopic)4 IllegalStateException (javax.jms.IllegalStateException)3 ActiveMQAddressExistsException (org.apache.activemq.artemis.api.core.ActiveMQAddressExistsException)3 ActiveMQQueueExistsException (org.apache.activemq.artemis.api.core.ActiveMQQueueExistsException)3 SimpleString (org.apache.activemq.artemis.api.core.SimpleString)3 AMQConnectionContext (org.apache.activemq.artemis.core.protocol.openwire.amq.AMQConnectionContext)3 IOException (java.io.IOException)2 InvalidClientIDException (javax.jms.InvalidClientIDException)2 InvalidDestinationException (javax.jms.InvalidDestinationException)2 JMSSecurityException (javax.jms.JMSSecurityException)2 XAException (javax.transaction.xa.XAException)2 ActiveMQException (org.apache.activemq.artemis.api.core.ActiveMQException)2 ActiveMQNonExistentQueueException (org.apache.activemq.artemis.api.core.ActiveMQNonExistentQueueException)2 ActiveMQRemoteDisconnectException (org.apache.activemq.artemis.api.core.ActiveMQRemoteDisconnectException)2 ActiveMQSecurityException (org.apache.activemq.artemis.api.core.ActiveMQSecurityException)2 ActiveMQDestination (org.apache.activemq.command.ActiveMQDestination)2 ActiveMQTempQueue (org.apache.activemq.command.ActiveMQTempQueue)2 Connection (javax.jms.Connection)1 Destination (javax.jms.Destination)1