mirror of https://github.com/apache/activemq.git
Apply patch for https://issues.apache.org/activemq/browse/AMQ-1761
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@663048 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2ccbdefc69
commit
5cd2921c4e
|
@ -239,8 +239,16 @@ public class DestinationView implements DestinationViewMBean {
|
|||
public String sendTextMessage(String body) throws Exception {
|
||||
return sendTextMessage(Collections.EMPTY_MAP, body);
|
||||
}
|
||||
|
||||
|
||||
public String sendTextMessage(Map headers, String body) throws Exception {
|
||||
return sendTextMessage(headers,body,null,null);
|
||||
}
|
||||
|
||||
public String sendTextMessage(String body, String user, String password) throws Exception {
|
||||
return sendTextMessage(Collections.EMPTY_MAP,body,null,null);
|
||||
}
|
||||
|
||||
public String sendTextMessage(Map headers, String body,String userName,String password) throws Exception {
|
||||
|
||||
String brokerUrl = "vm://" + broker.getBrokerName();
|
||||
ActiveMQDestination dest = destination.getActiveMQDestination();
|
||||
|
@ -249,7 +257,7 @@ public class DestinationView implements DestinationViewMBean {
|
|||
Connection connection = null;
|
||||
try {
|
||||
|
||||
connection = cf.createConnection();
|
||||
connection = cf.createConnection(userName,password);
|
||||
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
|
||||
MessageProducer producer = session.createProducer(dest);
|
||||
ActiveMQTextMessage msg = (ActiveMQTextMessage)session.createTextMessage(body);
|
||||
|
@ -333,6 +341,5 @@ public class DestinationView implements DestinationViewMBean {
|
|||
|
||||
public void setUseCache(boolean value) {
|
||||
destination.setUseCache(value);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -133,6 +133,27 @@ public interface DestinationViewMBean {
|
|||
*/
|
||||
String sendTextMessage(Map headers, String body) throws Exception;
|
||||
|
||||
/**
|
||||
* Sends a TextMesage to the destination.
|
||||
* @param body the text to send
|
||||
* @param user
|
||||
* @param password
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
String sendTextMessage(String body, String user, String password) throws Exception;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param headers the message headers and properties to set. Can only
|
||||
* container Strings maped to primitive types.
|
||||
* @param body the text to send
|
||||
* @param user
|
||||
* @param password
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
String sendTextMessage(Map headers, String body, String user, String password) throws Exception;
|
||||
/**
|
||||
* @return the percentage of amount of memory used
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue