@Override public void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info) throws Exception { if (isLogAll() || isLogConsumerEvents()) { LOG.info("Removing subscription: {}", info); } super.removeSubscription(context, info); }
@Override public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { if (isLogAll() || isLogConsumerEvents()) { LOG.info("Removing Consumer: {}", info); } super.removeConsumer(context, info); }
@Override public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { if (isLogAll() || isLogConsumerEvents()) { LOG.info("Adding Consumer: {}", info); } return super.addConsumer(context, info); }
@Override public void postProcessDispatch(MessageDispatch messageDispatch) { if (isLogAll() || isLogInternalEvents() || isLogConsumerEvents()) { LOG.info("postProcessDispatch: {}", messageDispatch); } super.postProcessDispatch(messageDispatch); }
@Override public void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception { if (isLogAll() || isLogInternalEvents() || isLogConsumerEvents()) { LOG.info("ProcessDispatchNotification: {}", messageDispatchNotification); } super.processDispatchNotification(messageDispatchNotification); }
@Override public String toString() { StringBuffer buf = new StringBuffer(); buf.append("LoggingBrokerPlugin("); buf.append("logAll="); buf.append(isLogAll()); buf.append(", logConnectionEvents="); buf.append(isLogConnectionEvents()); buf.append(", logSessionEvents="); buf.append(isLogSessionEvents()); buf.append(", logConsumerEvents="); buf.append(isLogConsumerEvents()); buf.append(", logProducerEvents="); buf.append(isLogProducerEvents()); buf.append(", logTransactionEvents="); buf.append(isLogTransactionEvents()); buf.append(", logInternalEvents="); buf.append(isLogInternalEvents()); buf.append(")"); return buf.toString(); }
@Override public void preProcessDispatch(MessageDispatch messageDispatch) { if (isLogAll() || isLogInternalEvents() || isLogConsumerEvents()) { LOG.info("preProcessDispatch: {}", messageDispatch); } super.preProcessDispatch(messageDispatch); }
@Override public void slowConsumer(ConnectionContext context, Destination destination, Subscription subs) { if (isLogAll() || isLogConsumerEvents() || isLogInternalEvents()) { LOG.info("Detected slow consumer on {}", destination.getName()); StringBuffer buf = new StringBuffer("Connection("); buf.append(subs.getConsumerInfo().getConsumerId().getConnectionId()); buf.append(") Session("); buf.append(subs.getConsumerInfo().getConsumerId().getSessionId()); buf.append(")"); LOG.info(buf.toString()); } super.slowConsumer(context, destination, subs); }
@Override public void messageDelivered(ConnectionContext context, MessageReference messageReference) { if (isLogAll() || isLogConsumerEvents() || isLogInternalEvents()) { String msg = "Unable to display message."; msg = messageReference.getMessage().toString(); LOG.info("Message delivered: {}", msg); } super.messageDelivered(context, messageReference); }
@Override public Response messagePull(ConnectionContext context, MessagePull pull) throws Exception { if (isLogAll() || isLogConsumerEvents()) { LOG.info("Message Pull from: {} on {}", context.getClientId(), pull.getDestination().getPhysicalName()); } return super.messagePull(context, pull); }
@Override public void messageConsumed(ConnectionContext context, MessageReference messageReference) { if (isLogAll() || isLogConsumerEvents() || isLogInternalEvents()) { String msg = "Unable to display message."; msg = messageReference.getMessage().toString(); LOG.info("Message consumed: {}", msg); } super.messageConsumed(context, messageReference); }
@Override public void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws Exception { if (isLogAll() || isLogConsumerEvents()) { LOG.info("Acknowledging message for client ID: {}{}", consumerExchange.getConnectionContext().getClientId(), (ack.getMessageCount() == 1 ? ", " + ack.getLastMessageId() : "")); if (ack.getMessageCount() > 1) { LOG.trace("Message count: {}, First Message Id: {}, Last Message Id: {}", new Object[]{ ack.getMessageCount(), ack.getFirstMessageId(), ack.getLastMessageId() }); } } super.acknowledge(consumerExchange, ack); }
@Override public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { if (isLogAll() || isLogConsumerEvents()) { LOG.info("Adding Consumer: {}", info); } return super.addConsumer(context, info); }
@Override public void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info) throws Exception { if (isLogAll() || isLogConsumerEvents()) { LOG.info("Removing subscription: {}", info); } super.removeSubscription(context, info); }
@Override public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { if (isLogAll() || isLogConsumerEvents()) { LOG.info("Adding Consumer: {}", info); } return super.addConsumer(context, info); }
@Override public void preProcessDispatch(MessageDispatch messageDispatch) { if (isLogAll() || isLogInternalEvents() || isLogConsumerEvents()) { LOG.info("preProcessDispatch: {}", messageDispatch); } super.preProcessDispatch(messageDispatch); }
@Override public void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception { if (isLogAll() || isLogInternalEvents() || isLogConsumerEvents()) { LOG.info("ProcessDispatchNotification: {}", messageDispatchNotification); } super.processDispatchNotification(messageDispatchNotification); }
@Override public void postProcessDispatch(MessageDispatch messageDispatch) { if (isLogAll() || isLogInternalEvents() || isLogConsumerEvents()) { LOG.info("postProcessDispatch: {}", messageDispatch); } super.postProcessDispatch(messageDispatch); }
@Override public void postProcessDispatch(MessageDispatch messageDispatch) { if (isLogAll() || isLogInternalEvents() || isLogConsumerEvents()) { LOG.info("postProcessDispatch: {}", messageDispatch); } super.postProcessDispatch(messageDispatch); }
@Override public Response messagePull(ConnectionContext context, MessagePull pull) throws Exception { if (isLogAll() || isLogConsumerEvents()) { LOG.info("Message Pull from: {} on {}", context.getClientId(), pull.getDestination().getPhysicalName()); } return super.messagePull(context, pull); }