/** * Send a ClientMessage to the server * * @param message the message to send */ public void sendMessage(ClientMessage message) { try { producer.send(message); } catch (ActiveMQException amqEx) { throw new ActiveMQClientResourceException(String.format("Failed to send message to %s", producer.getAddress().toString()), amqEx); } }
/** * Send a ClientMessage to the server * * @param message the message to send */ public void sendMessage(ClientMessage message) { try { producer.send(message); } catch (ActiveMQException amqEx) { throw new ActiveMQClientResourceException(String.format("Failed to send message to %s", producer.getAddress().toString()), amqEx); } }
@Test public void testCreateProducer1() throws Exception { ClientProducer producer = clientSession.createProducer("testAddress"); Assert.assertNotNull(producer.getAddress()); Assert.assertEquals(cf.getServerLocator().getProducerMaxRate(), producer.getMaxRate()); Assert.assertEquals(cf.getServerLocator().isBlockOnNonDurableSend(), producer.isBlockOnNonDurableSend()); Assert.assertEquals(cf.getServerLocator().isBlockOnDurableSend(), producer.isBlockOnDurableSend()); Assert.assertFalse(producer.isClosed()); }
@Test public void testCreateAnonProducer() throws Exception { ClientProducer producer = clientSession.createProducer(); Assert.assertNull(producer.getAddress()); Assert.assertEquals(cf.getServerLocator().getProducerMaxRate(), producer.getMaxRate()); Assert.assertEquals(cf.getServerLocator().isBlockOnNonDurableSend(), producer.isBlockOnNonDurableSend()); Assert.assertEquals(cf.getServerLocator().isBlockOnDurableSend(), producer.isBlockOnDurableSend()); Assert.assertFalse(producer.isClosed()); }