Search in sources :

Example 96 with ConnectionInfo

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

the class ConnectionInfoTest method createObject.

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

Example 97 with ConnectionInfo

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

the class XBeanConfigTest method setUp.

@Override
protected void setUp() throws Exception {
    System.setProperty("brokername", "testbroker");
    brokerService = createBroker();
    broker = brokerService.getBroker();
    // started automatically
    // brokerService.start();
    context = new ConnectionContext();
    context.setBroker(broker);
    info = new ConnectionInfo();
    info.setClientId("James");
    info.setUserName("James");
    info.setConnectionId(new ConnectionId("1234"));
    try {
        broker.addConnection(context, info);
    } catch (Throwable e) {
        e.printStackTrace();
        fail(e.getMessage());
    }
    assertNotNull("No broker created!");
}
Also used : ConnectionId(org.apache.activemq.command.ConnectionId) ConnectionContext(org.apache.activemq.broker.ConnectionContext) ConnectionInfo(org.apache.activemq.command.ConnectionInfo)

Example 98 with ConnectionInfo

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

the class ConnectionInfoTest method createObject.

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

Example 99 with ConnectionInfo

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

the class ConnectionInfoTest method populateObject.

@Override
protected void populateObject(Object object) throws Exception {
    super.populateObject(object);
    ConnectionInfo info = (ConnectionInfo) object;
    info.setConnectionId(createConnectionId("ConnectionId:1"));
    info.setClientId("ClientId:2");
    info.setPassword("Password:3");
    info.setUserName("UserName:4");
    {
        BrokerId[] value = new BrokerId[2];
        for (int i = 0; i < 2; i++) {
            value[i] = createBrokerId("BrokerPath:5");
        }
        info.setBrokerPath(value);
    }
    info.setBrokerMasterConnector(true);
    info.setManageable(false);
    info.setClientMaster(true);
    info.setFaultTolerant(false);
    info.setFailoverReconnect(true);
}
Also used : ConnectionInfo(org.apache.activemq.command.ConnectionInfo)

Example 100 with ConnectionInfo

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

the class RecoverExpiredMessagesTest method sendSomeMessagesThatWillExpireIn5AndThenOne.

private void sendSomeMessagesThatWillExpireIn5AndThenOne() throws Exception {
    // Setup the producer and send the message.
    StubConnection connection = createConnection();
    ConnectionInfo connectionInfo = createConnectionInfo();
    SessionInfo sessionInfo = createSessionInfo(connectionInfo);
    ProducerInfo producerInfo = createProducerInfo(sessionInfo);
    connection.send(connectionInfo);
    connection.send(sessionInfo);
    connection.send(producerInfo);
    int MESSAGE_COUNT = 10;
    for (int i = 0; i < MESSAGE_COUNT; i++) {
        Message message = createMessage(producerInfo, destination);
        message.setExpiration(System.currentTimeMillis() + 5000);
        message.setPersistent(true);
        connection.send(message);
    }
    Message message = createMessage(producerInfo, destination);
    message.setPersistent(true);
    connection.send(message);
    expected.add(message.getMessageId().toString());
    connection.request(closeConnectionInfo(connectionInfo));
}
Also used : ProducerInfo(org.apache.activemq.command.ProducerInfo) Message(org.apache.activemq.command.Message) StubConnection(org.apache.activemq.broker.StubConnection) SessionInfo(org.apache.activemq.command.SessionInfo) ConnectionInfo(org.apache.activemq.command.ConnectionInfo)

Aggregations

ConnectionInfo (org.apache.activemq.command.ConnectionInfo)110 SessionInfo (org.apache.activemq.command.SessionInfo)77 ConsumerInfo (org.apache.activemq.command.ConsumerInfo)76 ProducerInfo (org.apache.activemq.command.ProducerInfo)72 Message (org.apache.activemq.command.Message)71 ActiveMQDestination (org.apache.activemq.command.ActiveMQDestination)44 StubConnection (org.apache.activemq.broker.StubConnection)18 ActiveMQQueue (org.apache.activemq.command.ActiveMQQueue)18 MessageAck (org.apache.activemq.command.MessageAck)15 XATransactionId (org.apache.activemq.command.XATransactionId)15 ActiveMQTopic (org.apache.activemq.command.ActiveMQTopic)12 DataArrayResponse (org.apache.activemq.command.DataArrayResponse)10 TransactionInfo (org.apache.activemq.command.TransactionInfo)9 LocalTransactionId (org.apache.activemq.command.LocalTransactionId)8 ConnectionId (org.apache.activemq.command.ConnectionId)6 RemoveInfo (org.apache.activemq.command.RemoveInfo)6 IOException (java.io.IOException)5 Response (org.apache.activemq.command.Response)5 Test (org.junit.Test)5 ConnectionContext (org.apache.activemq.broker.ConnectionContext)4