Or does those blobs contain serialized/crypted objects?
yes the message is serialized.
Does anyone know a configurable web application (war) which can be used to monitor jms queues. I used hermesJMS a bit but I am searching for a web based solution.
Thx for hints.
If you want to get the javax.jms.Message (or any other message types that you have added to the queue) the following will help.
Note that most of the source is copied from JDBCPersistenceManager class in package "jboss-messaging-1.4.2.GA-SP1
Write a query to retrieve all columns from JBM_MSG
long messageId = rs.getLong("MESSAGE_ID");
boolean reliable = rs.getString("RELIABLE").equals("Y");
long expiration = rs.getLong("EXPIRATION");
long timestamp = rs.getLong("TIMESTAMP");
byte priority = rs.getByte("PRIORITY");
byte bytes = getBytes(rs, "HEADERS");
HashMap headers = bytesToMap(bytes);
byte payload = getBytes(rs, "PAYLOAD");
byte type = rs.getByte("TYPE");
MapMessage m = (MapMessage)MessageFactory.createMessage(messageId, reliable, expiration, timestamp, priority, headers, payload,
protected byte getBytes(ResultSet rs, String column) throws Exception
// Get the bytes using a binary stream - likely to be better for large
InputStream is = null;
ByteArrayOutputStream os = null;
final int BUFFER_SIZE = 4096;
InputStream i = rs.getBinaryStream(column);
if (i == null)
is = new BufferedInputStream(rs.getBinaryStream(column), BUFFER_SIZE);
os = new ByteArrayOutputStream(BUFFER_SIZE);
while ((b = is.read()) != -1)
if (is != null)
if (os != null)
would you say this solution is suitable for production code or just for debugging? Would it work for retrieving all messages in a clustered queue? It might be just the thing I'm looking for - see my post at https://community.jboss.org/thread/197924. But I feel like this is meddling with JBoss internals, so maybe it shouldn't be used in production?
Sorry for the late reply. I haven't used it in production. Well are you refering to licensing issues is it? Well personally I never felt so as I have been only using their methods. Please correct me if I am wrong as I may use it if I need in the future. Technically I dont see any issues as I am only trying to view the messages.
Thanks for your reply. I was rather thinking about maintainability and stability - what if we move to a newer version of JBoss and they change the way the messages are internally stored? As this seems to be no public API, I guess they could change it any time. Then we would have to change our code as well.
We ended up creating our own database table to log whenever a message is produced or consumed, so we keep track of the existing messages "manually".
Yes Lars there is a problem as such and its good to know how you solved the problem.
Chances of it affecting our application is very small as we use only a specific version & we wouldnt change it, so was not concerned about it.
Thanks for pointing it out, If I use it, I should actually document it somewhere.
very good !
it's works ! thank you ,by the way,what is the method about "bytesToMap()" is it likes 'getBytes()' method?