@Test public void testSendToQueueWithOverrides() throws JMSException { JmsPoolConnection connection = (JmsPoolConnection) cf.createTopicConnection(); QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); Queue queue = session.createTemporaryQueue(); QueueSender sender = session.createSender(null); final AtomicBoolean sent = new AtomicBoolean(); MockJMSConnection mockConnection = (MockJMSConnection) connection.getConnection(); mockConnection.addConnectionListener(new MockJMSDefaultConnectionListener() { @Override public void onMessageSend(MockJMSSession session, MockJMSMessageProducer producer, Message message) throws JMSException { assertEquals(DeliveryMode.PERSISTENT, message.getJMSDeliveryMode()); assertEquals(9, message.getJMSPriority()); assertTrue(message.getJMSExpiration() != 0); sent.set(true); } }); sender.send(queue, session.createTextMessage(), DeliveryMode.PERSISTENT, 9, 100); assertTrue(sent.get()); }
@Override public void send(Queue queue, Message message, int deliveryMode, int priority, long timeToLine) throws JMSException { super.send(queue, message, deliveryMode, priority, timeToLine); }
JmsPoolQueueSender extends JmsPoolMessageProducer implements QueueSender, AutoCloseable { @Override public void send(Queue queue, Message message, int deliveryMode, int priority, long timeToLine) throws JMSException { super.send(queue, message, deliveryMode, priority, timeToLine); } }
JmsPoolQueueSender extends JmsPoolMessageProducer implements QueueSender, AutoCloseable { @Override public void send(Queue queue, Message message, int deliveryMode, int priority, long timeToLine) throws JMSException { super.send(queue, message, deliveryMode, priority, timeToLine); } JmsPoolQueueSender(JmsPoolSession session, QueueSender messageProducer, Destination destination, AtomicInteger refCount); }
JmsPoolQueueSender extends JmsPoolMessageProducer implements QueueSender, AutoCloseable { @Override public void send(Queue queue, Message message, int deliveryMode, int priority, long timeToLine) throws JMSException { super.send(queue, message, deliveryMode, priority, timeToLine); } JmsPoolQueueSender(JmsPoolSession session, QueueSender messageProducer, Destination destination, AtomicInteger refCount); @Override void send(Queue queue, Message message, int deliveryMode, int priority, long timeToLine); @Override void send(Queue queue, Message message); @Override Queue getQueue(); @Override String toString(); QueueSender getQueueSender(); }
JmsPoolQueueSender extends JmsPoolMessageProducer implements QueueSender, AutoCloseable { @Override public void send(Queue queue, Message message, int deliveryMode, int priority, long timeToLine) throws JMSException { super.send(queue, message, deliveryMode, priority, timeToLine); } JmsPoolQueueSender(JmsPoolSession session, QueueSender messageProducer, Destination destination, AtomicInteger refCount); @Override void send(Queue queue, Message message, int deliveryMode, int priority, long timeToLine); @Override void send(Queue queue, Message message); @Override Queue getQueue(); @Override String toString(); QueueSender getQueueSender();  }