@Override public String getBrokerName() { return safeGetBroker().getBrokerName(); }
@Override public String sendTextMessage(Map<String, String> headers, String body, String userName, @Sensitive String password) throws Exception { String brokerUrl = "vm://" + broker.getBrokerName(); ActiveMQDestination dest = destination.getActiveMQDestination();
public String getBrokerName() { return broker.getBrokerName(); }
@Override public String getBrokerName() { return safeGetBroker().getBrokerName(); }
@Override public String getBrokerName() { return safeGetBroker().getBrokerName(); }
@Override public String getBrokerName() { return safeGetBroker().getBrokerName(); }
public String sendTextMessage(Map headers, String body, String userName, String password) throws Exception { String brokerUrl = "vm://" + broker.getBrokerName(); ActiveMQDestination dest = destination.getActiveMQDestination(); ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory(brokerUrl); Connection connection = null; try { connection = cf.createConnection(userName, password); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); MessageProducer producer = session.createProducer(dest); ActiveMQTextMessage msg = (ActiveMQTextMessage) session.createTextMessage(body); for (Iterator iter = headers.entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next(); msg.setObjectProperty((String) entry.getKey(), entry.getValue()); } producer.setDeliveryMode(msg.getJMSDeliveryMode()); producer.setPriority(msg.getPriority()); long ttl = msg.getExpiration() - System.currentTimeMillis(); producer.setTimeToLive(ttl > 0 ? ttl : 0); producer.send(msg); return msg.getJMSMessageID(); } finally { connection.close(); } }
@Override public String sendTextMessage(Map<String, String> headers, String body, String userName, @Sensitive String password) throws Exception { String brokerUrl = "vm://" + broker.getBrokerName(); ActiveMQDestination dest = destination.getActiveMQDestination();
@Override public String sendTextMessage(Map<String, String> headers, String body, String userName, @Sensitive String password) throws Exception { String brokerUrl = "vm://" + broker.getBrokerName(); ActiveMQDestination dest = destination.getActiveMQDestination();
@Override public String sendTextMessage(Map<String, String> headers, String body, String userName, @Sensitive String password) throws Exception { String brokerUrl = "vm://" + broker.getBrokerName(); ActiveMQDestination dest = destination.getActiveMQDestination();