本文整理了Java中org.apache.activemq.broker.Broker.removeConsumer()
方法的一些代码示例,展示了Broker.removeConsumer()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Broker.removeConsumer()
方法的具体详情如下:
包路径:org.apache.activemq.broker.Broker
类名称:Broker
方法名:removeConsumer
暂无
代码示例来源:origin: apache/activemq
@Override
public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception {
next.removeConsumer(context, info);
Broker brokers[] = getListeners();
for (int i = 0; i < brokers.length; i++) {
brokers[i].removeConsumer(context, info);
}
}
代码示例来源:origin: apache/activemq
@Override
public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception {
getNext().removeConsumer(context, info);
}
代码示例来源:origin: apache/activemq
@Override
public Response processRemoveConsumer(ConsumerId id, long lastDeliveredSequenceId) throws Exception {
SessionId sessionId = id.getParentId();
ConnectionId connectionId = sessionId.getParentId();
TransportConnectionState cs = lookupConnectionState(connectionId);
if (cs == null) {
throw new IllegalStateException("Cannot remove a consumer from a connection that had not been registered: "
+ connectionId);
}
SessionState ss = cs.getSessionState(sessionId);
if (ss == null) {
throw new IllegalStateException("Cannot remove a consumer from a session that had not been registered: "
+ sessionId);
}
ConsumerState consumerState = ss.removeConsumer(id);
if (consumerState == null) {
throw new IllegalStateException("Cannot remove a consumer that had not been registered: " + id);
}
ConsumerInfo info = consumerState.getInfo();
info.setLastDeliveredSequenceId(lastDeliveredSequenceId);
broker.removeConsumer(cs.getContext(), consumerState.getInfo());
removeConsumerBrokerExchange(id);
return null;
}
代码示例来源:origin: apache/activemq
addConsumerBrokerExchange(cs, info.getConsumerId());
} catch (IllegalStateException e) {
broker.removeConsumer(cs.getContext(), info);
代码示例来源:origin: pierre/meteo
public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception {
next.removeConsumer(context, info);
}
代码示例来源:origin: org.apache.activemq/activemq-broker
@Override
public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception {
next.removeConsumer(context, info);
Broker brokers[] = getListeners();
for (int i = 0; i < brokers.length; i++) {
brokers[i].removeConsumer(context, info);
}
}
代码示例来源:origin: org.apache.activemq/activemq-osgi
@Override
public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception {
next.removeConsumer(context, info);
Broker brokers[] = getListeners();
for (int i = 0; i < brokers.length; i++) {
brokers[i].removeConsumer(context, info);
}
}
代码示例来源:origin: pierre/meteo
@Override
public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception {
next.removeConsumer(context, info);
Broker brokers[] = getListeners();
for (int i = 0; i < brokers.length; i++) {
brokers[i].removeConsumer(context, info);
}
}
代码示例来源:origin: org.apache.activemq/activemq-all
@Override
public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception {
next.removeConsumer(context, info);
Broker brokers[] = getListeners();
for (int i = 0; i < brokers.length; i++) {
brokers[i].removeConsumer(context, info);
}
}
代码示例来源:origin: org.apache.activemq/activemq-broker
@Override
public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception {
getNext().removeConsumer(context, info);
}
代码示例来源:origin: org.apache.activemq/activemq-osgi
@Override
public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception {
getNext().removeConsumer(context, info);
}
代码示例来源:origin: org.apache.activemq/activemq-all
@Override
public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception {
getNext().removeConsumer(context, info);
}
代码示例来源:origin: pierre/meteo
public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception {
getNext().removeConsumer(context, info);
}
代码示例来源:origin: org.apache.activemq/activemq-osgi
@Override
public Response processRemoveConsumer(ConsumerId id, long lastDeliveredSequenceId) throws Exception {
SessionId sessionId = id.getParentId();
ConnectionId connectionId = sessionId.getParentId();
TransportConnectionState cs = lookupConnectionState(connectionId);
if (cs == null) {
throw new IllegalStateException("Cannot remove a consumer from a connection that had not been registered: "
+ connectionId);
}
SessionState ss = cs.getSessionState(sessionId);
if (ss == null) {
throw new IllegalStateException("Cannot remove a consumer from a session that had not been registered: "
+ sessionId);
}
ConsumerState consumerState = ss.removeConsumer(id);
if (consumerState == null) {
throw new IllegalStateException("Cannot remove a consumer that had not been registered: " + id);
}
ConsumerInfo info = consumerState.getInfo();
info.setLastDeliveredSequenceId(lastDeliveredSequenceId);
broker.removeConsumer(cs.getContext(), consumerState.getInfo());
removeConsumerBrokerExchange(id);
return null;
}
代码示例来源:origin: org.apache.activemq/activemq-broker
@Override
public Response processRemoveConsumer(ConsumerId id, long lastDeliveredSequenceId) throws Exception {
SessionId sessionId = id.getParentId();
ConnectionId connectionId = sessionId.getParentId();
TransportConnectionState cs = lookupConnectionState(connectionId);
if (cs == null) {
throw new IllegalStateException("Cannot remove a consumer from a connection that had not been registered: "
+ connectionId);
}
SessionState ss = cs.getSessionState(sessionId);
if (ss == null) {
throw new IllegalStateException("Cannot remove a consumer from a session that had not been registered: "
+ sessionId);
}
ConsumerState consumerState = ss.removeConsumer(id);
if (consumerState == null) {
throw new IllegalStateException("Cannot remove a consumer that had not been registered: " + id);
}
ConsumerInfo info = consumerState.getInfo();
info.setLastDeliveredSequenceId(lastDeliveredSequenceId);
broker.removeConsumer(cs.getContext(), consumerState.getInfo());
removeConsumerBrokerExchange(id);
return null;
}
代码示例来源:origin: org.apache.activemq/activemq-all
@Override
public Response processRemoveConsumer(ConsumerId id, long lastDeliveredSequenceId) throws Exception {
SessionId sessionId = id.getParentId();
ConnectionId connectionId = sessionId.getParentId();
TransportConnectionState cs = lookupConnectionState(connectionId);
if (cs == null) {
throw new IllegalStateException("Cannot remove a consumer from a connection that had not been registered: "
+ connectionId);
}
SessionState ss = cs.getSessionState(sessionId);
if (ss == null) {
throw new IllegalStateException("Cannot remove a consumer from a session that had not been registered: "
+ sessionId);
}
ConsumerState consumerState = ss.removeConsumer(id);
if (consumerState == null) {
throw new IllegalStateException("Cannot remove a consumer that had not been registered: " + id);
}
ConsumerInfo info = consumerState.getInfo();
info.setLastDeliveredSequenceId(lastDeliveredSequenceId);
broker.removeConsumer(cs.getContext(), consumerState.getInfo());
removeConsumerBrokerExchange(id);
return null;
}
代码示例来源:origin: pierre/meteo
public Response processRemoveConsumer(ConsumerId id, long lastDeliveredSequenceId) throws Exception {
SessionId sessionId = id.getParentId();
ConnectionId connectionId = sessionId.getParentId();
TransportConnectionState cs = lookupConnectionState(connectionId);
if (cs == null) {
throw new IllegalStateException("Cannot remove a consumer from a connection that had not been registered: "
+ connectionId);
}
SessionState ss = cs.getSessionState(sessionId);
if (ss == null) {
throw new IllegalStateException("Cannot remove a consumer from a session that had not been registered: "
+ sessionId);
}
ConsumerState consumerState = ss.removeConsumer(id);
if (consumerState == null) {
throw new IllegalStateException("Cannot remove a consumer that had not been registered: " + id);
}
ConsumerInfo info = consumerState.getInfo();
info.setLastDeliveredSequenceId(lastDeliveredSequenceId);
broker.removeConsumer(cs.getContext(), consumerState.getInfo());
removeConsumerBrokerExchange(id);
return null;
}
代码示例来源:origin: pierre/meteo
public Response processAddConsumer(ConsumerInfo info) throws Exception {
SessionId sessionId = info.getConsumerId().getParentId();
ConnectionId connectionId = sessionId.getParentId();
TransportConnectionState cs = lookupConnectionState(connectionId);
SessionState ss = cs.getSessionState(sessionId);
if (ss == null) {
throw new IllegalStateException(broker.getBrokerName()
+ " Cannot add a consumer to a session that had not been registered: " + sessionId);
}
// Avoid replaying dup commands
if (!ss.getConsumerIds().contains(info.getConsumerId())) {
broker.addConsumer(cs.getContext(), info);
try {
ss.addConsumer(info);
} catch (IllegalStateException e) {
broker.removeConsumer(cs.getContext(), info);
}
}
return null;
}
代码示例来源:origin: powertac/powertac-server
private void deleteDestination (Broker broker,
ActiveMQDestination amqDestination,
Destination destination) throws Exception
{
List<Subscription> subscriptions = destination.getConsumers();
for (Subscription subscription: subscriptions) {
ConsumerInfo info = new ConsumerInfo();
info.setDestination(amqDestination);
info.setConsumerId(subscription.getConsumerInfo().getConsumerId());
broker.removeConsumer(subscription.getContext(), info);
}
ConnectionContext context = new ConnectionContext();
context.setBroker(broker);
broker.removeDestination(context, amqDestination, 0);
log.info("processQueues - successfully remove queue " + destination.getName());
}
}
代码示例来源:origin: org.apache.activemq/activemq-broker
addConsumerBrokerExchange(cs, info.getConsumerId());
} catch (IllegalStateException e) {
broker.removeConsumer(cs.getContext(), info);
内容来源于网络,如有侵权,请联系作者删除!