@Override public void dispatch(MessageDispatch messageDispatch) { try { executor.execute(messageDispatch); } catch (InterruptedException e) { Thread.currentThread().interrupt(); connection.onClientInternalException(e); } }
public void dispatch(MessageDispatch md) { // Auto ack messages when we reach 75% of the prefetch deliveredCounter++; if (deliveredCounter > (0.75 * info.getPrefetchSize())) { try { MessageAck ack = new MessageAck(md, MessageAck.STANDARD_ACK_TYPE, deliveredCounter); connection.asyncSendPacket(ack); deliveredCounter = 0; } catch (JMSException e) { connection.onClientInternalException(e); } } DataStructure o = md.getMessage().getDataStructure(); if (o != null && o.getClass() == DestinationInfo.class) { processDestinationInfo((DestinationInfo)o); } else { //This can happen across networks if (LOG.isDebugEnabled()) { LOG.debug("Unexpected message was dispatched to the AdvisoryConsumer: "+md); } } }
}}, 0l); } catch (JMSException e) { connection.onClientInternalException(e); }}, 0l); } catch (JMSException e) { connection.onClientInternalException(e);
/** * @return the next message */ public Object nextElement() { while (true) { synchronized (this) { if (consumer == null) { return null; } } try { javax.jms.Message answer = consumer.receiveNoWait(); if (answer != null) { return answer; } } catch (JMSException e) { this.session.connection.onClientInternalException(e); return null; } if (browseDone.get() || !session.isRunning()) { destroyConsumer(); return null; } waitForMessage(); } }
public void dispatch(MessageDispatch messageDispatch) { try { messageDispatch.setConsumer(this); ServerSession serverSession = sessionPool.getServerSession(); Session s = serverSession.getSession(); ActiveMQSession session = null; if (s instanceof ActiveMQSession) { session = (ActiveMQSession)s; } else if (s instanceof ActiveMQTopicSession) { ActiveMQTopicSession topicSession = (ActiveMQTopicSession)s; session = (ActiveMQSession)topicSession.getNext(); } else if (s instanceof ActiveMQQueueSession) { ActiveMQQueueSession queueSession = (ActiveMQQueueSession)s; session = (ActiveMQSession)queueSession.getNext(); } else { connection.onClientInternalException(new JMSException("Session pool provided an invalid session type: " + s.getClass())); return; } session.dispatch(messageDispatch); serverSession.start(); } catch (JMSException e) { connection.onAsyncException(e); } }
} catch (Throwable t) { LOG.error("error dispatching ack: {} ", earlyAck, t); connection.onClientInternalException(t); } finally { continue; connection.onClientInternalException(e); } finally { if (ack.getTransactionId() == null) { asyncSendPacket(ack); } catch (Throwable e) { connection.onClientInternalException(e); executor.waitForQueueRestart(); } catch (InterruptedException ex) { connection.onClientInternalException(ex);
session.connection.onClientInternalException(e);
@Override public void dispatch(MessageDispatch messageDispatch) { try { executor.execute(messageDispatch); } catch (InterruptedException e) { Thread.currentThread().interrupt(); connection.onClientInternalException(e); } }
@Override public void dispatch(MessageDispatch messageDispatch) { try { executor.execute(messageDispatch); } catch (InterruptedException e) { Thread.currentThread().interrupt(); connection.onClientInternalException(e); } }
@Override public void dispatch(MessageDispatch messageDispatch) { try { executor.execute(messageDispatch); } catch (InterruptedException e) { Thread.currentThread().interrupt(); connection.onClientInternalException(e); } }
public void dispatch(MessageDispatch messageDispatch) { try { executor.execute(messageDispatch); } catch (InterruptedException e) { Thread.currentThread().interrupt(); connection.onClientInternalException(e); } }
public void dispatch(MessageDispatch md) { // Auto ack messages when we reach 75% of the prefetch deliveredCounter++; if (deliveredCounter > (0.75 * info.getPrefetchSize())) { try { MessageAck ack = new MessageAck(md, MessageAck.STANDARD_ACK_TYPE, deliveredCounter); connection.asyncSendPacket(ack); deliveredCounter = 0; } catch (JMSException e) { connection.onClientInternalException(e); } } DataStructure o = md.getMessage().getDataStructure(); if (o != null && o.getClass() == DestinationInfo.class) { processDestinationInfo((DestinationInfo)o); } else { //This can happen across networks if (LOG.isDebugEnabled()) { LOG.debug("Unexpected message was dispatched to the AdvisoryConsumer: "+md); } } }
public void dispatch(MessageDispatch md) { // Auto ack messages when we reach 75% of the prefetch deliveredCounter++; if (deliveredCounter > (0.75 * info.getPrefetchSize())) { try { MessageAck ack = new MessageAck(md, MessageAck.STANDARD_ACK_TYPE, deliveredCounter); connection.asyncSendPacket(ack); deliveredCounter = 0; } catch (JMSException e) { connection.onClientInternalException(e); } } DataStructure o = md.getMessage().getDataStructure(); if (o != null && o.getClass() == DestinationInfo.class) { processDestinationInfo((DestinationInfo)o); } else { //This can happen across networks if (LOG.isDebugEnabled()) { LOG.debug("Unexpected message was dispatched to the AdvisoryConsumer: "+md); } } }
public void dispatch(MessageDispatch md) { // Auto ack messages when we reach 75% of the prefetch deliveredCounter++; if (deliveredCounter > (0.75 * info.getPrefetchSize())) { try { MessageAck ack = new MessageAck(md, MessageAck.STANDARD_ACK_TYPE, deliveredCounter); connection.asyncSendPacket(ack); deliveredCounter = 0; } catch (JMSException e) { connection.onClientInternalException(e); } } DataStructure o = md.getMessage().getDataStructure(); if (o != null && o.getClass() == DestinationInfo.class) { processDestinationInfo((DestinationInfo)o); } else { //This can happen across networks if (LOG.isDebugEnabled()) { LOG.debug("Unexpected message was dispatched to the AdvisoryConsumer: "+md); } } }
public void dispatch(MessageDispatch md) { // Auto ack messages when we reach 75% of the prefetch deliveredCounter++; if (deliveredCounter > (0.75 * info.getPrefetchSize())) { try { MessageAck ack = new MessageAck(md, MessageAck.STANDARD_ACK_TYPE, deliveredCounter); connection.asyncSendPacket(ack); deliveredCounter = 0; } catch (JMSException e) { connection.onClientInternalException(e); } } DataStructure o = md.getMessage().getDataStructure(); if (o != null && o.getClass() == DestinationInfo.class) { processDestinationInfo((DestinationInfo)o); } else { //This can happen across networks if (LOG.isDebugEnabled()) { LOG.debug("Unexpected message was dispatched to the AdvisoryConsumer: "+md); } } }
/** * @return the next message */ public Object nextElement() { while (true) { synchronized (this) { if (consumer == null) { return null; } } try { javax.jms.Message answer = consumer.receiveNoWait(); if (answer != null) { return answer; } } catch (JMSException e) { this.session.connection.onClientInternalException(e); return null; } if (browseDone.get() || !session.isRunning()) { destroyConsumer(); return null; } waitForMessage(); } }
/** * @return the next message */ public Object nextElement() { while (true) { synchronized (this) { if (consumer == null) { return null; } } try { javax.jms.Message answer = consumer.receiveNoWait(); if (answer != null) { return answer; } } catch (JMSException e) { this.session.connection.onClientInternalException(e); return null; } if (browseDone.get() || !session.isRunning()) { destroyConsumer(); return null; } waitForMessage(); } }
public void dispatch(MessageDispatch messageDispatch) { try { messageDispatch.setConsumer(this); ServerSession serverSession = sessionPool.getServerSession(); Session s = serverSession.getSession(); ActiveMQSession session = null; if (s instanceof ActiveMQSession) { session = (ActiveMQSession)s; } else if (s instanceof ActiveMQTopicSession) { ActiveMQTopicSession topicSession = (ActiveMQTopicSession)s; session = (ActiveMQSession)topicSession.getNext(); } else if (s instanceof ActiveMQQueueSession) { ActiveMQQueueSession queueSession = (ActiveMQQueueSession)s; session = (ActiveMQSession)queueSession.getNext(); } else { connection.onClientInternalException(new JMSException("Session pool provided an invalid session type: " + s.getClass())); return; } session.dispatch(messageDispatch); serverSession.start(); } catch (JMSException e) { connection.onAsyncException(e); } }
public void dispatch(MessageDispatch messageDispatch) { try { messageDispatch.setConsumer(this); ServerSession serverSession = sessionPool.getServerSession(); Session s = serverSession.getSession(); ActiveMQSession session = null; if (s instanceof ActiveMQSession) { session = (ActiveMQSession)s; } else if (s instanceof ActiveMQTopicSession) { ActiveMQTopicSession topicSession = (ActiveMQTopicSession)s; session = (ActiveMQSession)topicSession.getNext(); } else if (s instanceof ActiveMQQueueSession) { ActiveMQQueueSession queueSession = (ActiveMQQueueSession)s; session = (ActiveMQSession)queueSession.getNext(); } else { connection.onClientInternalException(new JMSException("Session pool provided an invalid session type: " + s.getClass())); return; } session.dispatch(messageDispatch); serverSession.start(); } catch (JMSException e) { connection.onAsyncException(e); } }