Search in sources :

Example 6 with Channel

use of org.apache.activemq.artemis.core.protocol.core.Channel in project activemq-artemis by apache.

the class RemotingConnectionImpl method killMessage.

@Override
public void killMessage(SimpleString nodeID) {
    if (channelVersion < DisconnectConsumerWithKillMessage.VERSION_INTRODUCED) {
        return;
    }
    Channel clientChannel = getChannel(1, -1);
    DisconnectConsumerWithKillMessage response = new DisconnectConsumerWithKillMessage(nodeID);
    clientChannel.send(response, -1);
}
Also used : Channel(org.apache.activemq.artemis.core.protocol.core.Channel) DisconnectConsumerWithKillMessage(org.apache.activemq.artemis.core.protocol.core.impl.wireformat.DisconnectConsumerWithKillMessage)

Example 7 with Channel

use of org.apache.activemq.artemis.core.protocol.core.Channel in project activemq-artemis by apache.

the class RemotingConnectionImpl method getChannel.

@Override
public synchronized Channel getChannel(final long channelID, final int confWindowSize) {
    Channel channel = channels.get(channelID);
    if (channel == null) {
        channel = new ChannelImpl(this, channelID, confWindowSize, outgoingInterceptors);
        channels.put(channelID, channel);
    }
    return channel;
}
Also used : Channel(org.apache.activemq.artemis.core.protocol.core.Channel)

Example 8 with Channel

use of org.apache.activemq.artemis.core.protocol.core.Channel in project activemq-artemis by apache.

the class RemotingConnectionImpl method fail.

@Override
public void fail(final ActiveMQException me, String scaleDownTargetNodeID) {
    synchronized (failLock) {
        if (destroyed) {
            return;
        }
        destroyed = true;
    }
    if (!(me instanceof ActiveMQRemoteDisconnectException)) {
        ActiveMQClientLogger.LOGGER.connectionFailureDetected(me.getMessage(), me.getType());
    }
    try {
        transportConnection.forceClose();
    } catch (Throwable e) {
        ActiveMQClientLogger.LOGGER.failedForceClose(e);
    }
    // Then call the listeners
    callFailureListeners(me, scaleDownTargetNodeID);
    callClosingListeners();
    internalClose();
    for (Channel channel : channels.values()) {
        channel.returnBlocking(me);
    }
}
Also used : ActiveMQRemoteDisconnectException(org.apache.activemq.artemis.api.core.ActiveMQRemoteDisconnectException) Channel(org.apache.activemq.artemis.core.protocol.core.Channel)

Example 9 with Channel

use of org.apache.activemq.artemis.core.protocol.core.Channel in project activemq-artemis by apache.

the class ActiveMQClientProtocolManager method stop.

@Override
public void stop() {
    alive = false;
    synchronized (inCreateSessionGuard) {
        if (inCreateSessionLatch != null)
            inCreateSessionLatch.countDown();
    }
    Channel channel1 = getChannel1();
    if (channel1 != null) {
        channel1.returnBlocking();
    }
    waitLatch.countDown();
}
Also used : Channel(org.apache.activemq.artemis.core.protocol.core.Channel)

Example 10 with Channel

use of org.apache.activemq.artemis.core.protocol.core.Channel in project activemq-artemis by apache.

the class ActiveMQClientProtocolManager method ping.

@Override
public void ping(long connectionTTL) {
    Channel channel = connection.getChannel(ChannelImpl.CHANNEL_ID.PING.id, -1);
    Ping ping = new Ping(connectionTTL);
    channel.send(ping);
    connection.flush();
}
Also used : Channel(org.apache.activemq.artemis.core.protocol.core.Channel) Ping(org.apache.activemq.artemis.core.protocol.core.impl.wireformat.Ping)

Aggregations

Channel (org.apache.activemq.artemis.core.protocol.core.Channel)12 Packet (org.apache.activemq.artemis.core.protocol.core.Packet)5 ActiveMQException (org.apache.activemq.artemis.api.core.ActiveMQException)4 CreateSessionResponseMessage (org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateSessionResponseMessage)3 HashSet (java.util.HashSet)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 Executor (java.util.concurrent.Executor)1 Lock (java.util.concurrent.locks.Lock)1 ActiveMQClusterSecurityException (org.apache.activemq.artemis.api.core.ActiveMQClusterSecurityException)1 ActiveMQIncompatibleClientServerException (org.apache.activemq.artemis.api.core.ActiveMQIncompatibleClientServerException)1 ActiveMQInternalErrorException (org.apache.activemq.artemis.api.core.ActiveMQInternalErrorException)1 ActiveMQRemoteDisconnectException (org.apache.activemq.artemis.api.core.ActiveMQRemoteDisconnectException)1 ActiveMQSecurityException (org.apache.activemq.artemis.api.core.ActiveMQSecurityException)1 RoutingType (org.apache.activemq.artemis.api.core.RoutingType)1 SimpleString (org.apache.activemq.artemis.api.core.SimpleString)1 TransportConfiguration (org.apache.activemq.artemis.api.core.TransportConfiguration)1 Configuration (org.apache.activemq.artemis.core.config.Configuration)1 OperationContext (org.apache.activemq.artemis.core.persistence.OperationContext)1 ServerPacketDecoder (org.apache.activemq.artemis.core.protocol.ServerPacketDecoder)1 ChannelHandler (org.apache.activemq.artemis.core.protocol.core.ChannelHandler)1