https://issues.apache.org/jira/browse/AMQ-4110 - web console sending messages to the secured broker - use default credentials defined in factory if not explicitly set

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1398731 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bosanac Dejan 2012-10-16 11:03:04 +00:00
parent 9e94ee40a2
commit 76153ff245
2 changed files with 19 additions and 1 deletions

View File

@ -112,6 +112,20 @@ public class MessageQuery extends QueueBrowseQuery {
return null;
}
public Map<String, Object> getPropertiesMap() throws JMSException {
Map<String, Object> answer = new HashMap<String, Object>();
Message aMessage = getMessage();
Enumeration iter = aMessage.getPropertyNames();
while (iter.hasMoreElements()) {
String name = (String) iter.nextElement();
Object value = aMessage.getObjectProperty(name);
if (value != null) {
answer.put(name, value);
}
}
return answer;
}
protected Map<String, Object> createMapBody(MapMessage mapMessage) throws JMSException {
Map<String, Object> answer = new HashMap<String, Object>();
Enumeration iter = mapMessage.getMapNames();

View File

@ -263,7 +263,11 @@ public class WebClient implements HttpSessionActivationListener, HttpSessionBind
public Connection getConnection() throws JMSException {
if (connection == null) {
connection = factory.createConnection(username, password);
if (username != null && password != null) {
connection = factory.createConnection(username, password);
} else {
connection = factory.createConnection();
}
connection.start();
}
return connection;