You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by skao <si...@gmail.com> on 2020/05/20 05:39:52 UTC

How to access KahaDB db.data in activeMQ-5.15.0 ?

Hi All,

I would like to view the KahaDB db.data to check the detail of enqueue
message body.
But it is binary file format.

Is there any tool to open the KahaDB db.data file or how to convert it to
txt file ?

Please kindly help.

Sincerely,
Samuel




--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: How to access KahaDB db.data in activeMQ-5.15.0 ?

Posted by Gary Tully <ga...@gmail.com>.
there is: https://github.com/apache/activemq-cli-tools/tree/master/activemq-kahadb-exporter

On Wed, 20 May 2020 at 10:16, Jean-Baptiste Onofre <jb...@nanthrax.net> wrote:
>
> Hi,
>
> You can:
>
> 1. Use JMX to browse the queue (directly or via REST thanks to Jolokia)
> 2. Use admin console
> 3. Use any client (including REST) to browse
> 4. Use jms:* command in Karaf
> 5. Dump kahadb or browse content using bin/activemq (browse, …) script
>
> Generally speaking, we never manipulate kahadb directly as it’s a specific database we did for ActiveMQ (so not "human readable").
>
> Regards
> JB
>
> > Le 20 mai 2020 à 07:39, skao <si...@gmail.com> a écrit :
> >
> > Hi All,
> >
> > I would like to view the KahaDB db.data to check the detail of enqueue
> > message body.
> > But it is binary file format.
> >
> > Is there any tool to open the KahaDB db.data file or how to convert it to
> > txt file ?
> >
> > Please kindly help.
> >
> > Sincerely,
> > Samuel
> >
> >
> >
> >
> > --
> > Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>

Re: How to access KahaDB db.data in activeMQ-5.15.0 ?

Posted by skao <si...@gmail.com>.
Hi Tim,

Hmmm... That is interesting.
Let me try to produce a new message in activemq and see if I can see the
json message body.

On the other hand, the plain text message is working fine that I can see the
message body.

Will try another json message to verify.

Regards,
Samuel



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: How to access KahaDB db.data in activeMQ-5.15.0 ?

Posted by Tim Bain <tb...@alumni.duke.edu>.
Two different methods of viewing the message content both indicate that
there's no message body? That sounds like maybe your messages don't have
bodies...

I'm not an expert in Camel, but I've done enough with it to believe that
the method you found will capture the full message (headers and body), so I
don't think there's reason to believe that the code you found is wrong or
doesn't work as expected.

Tim

Tim

On Tue, May 26, 2020, 12:23 PM skao <si...@gmail.com> wrote:

> This is exactly what I added in activemq.xml as below.
>
> It only created the header Info instead of the real message body.
> It looks exactly the same when I review it in activeMQ console.
> No detail message body.
>
>
> xmlns:camel="http://camel.apache.org/schema/spring"
>
> <bean  id="ActiveMQVMConnectionFactory"
> class="org.apache.activemq.ActiveMQConnectionFactory">
>                 <property name="brokerURL"
> value="vm://localhost?create=false&amp;waitForStart=10000"/>
>                 <property name="userName" value="${activemq.username}"/>
>                 <property name="password" value="${activemq.password}"/>
>         </bean>
>         <bean id="activemq"
> class="org.apache.activemq.camel.component.ActiveMQComponent" >
>                 <property name="connectionFactory"
> ref="ActiveMQVMConnectionFactory"/>
>         </bean>
>
>
> <camelContext id="camel" trace="false"
> xmlns="http://camel.apache.org/schema/spring">
>                 <route>
>                         <from
>
> uri="activemq:queue:*?mapJmsMessage=false&amp;selector=CamelFileNameProduced
> IS NULL" />
>                         <choice>
>                                 <when>
>
> <simple>${in.headers.CamelFileNameProduced} == null</simple>
>                                         <setHeader
> headerName="CamelJmsDestinationName">
>
> <simple>${in.header.JMSDestination.physicalName}</simple>
>                                         </setHeader>
>                                         <transform>
>
> <simple>${in.body}\n</simple>
>                                         </transform>
>                                         <to
>
> uri="file://data/activemq/?fileExist=Append&amp;fileName=routeMessages-${in.header.JMSDestination.physicalName}-${date:now:yyyyMMdd}.txt"
> />
>                                         <to uri="activemq:dummy" />
>                                 </when>
>                         </choice>
>                 </route>
>         </camelContext>
>
>
> Output :
>
> ActiveMQObjectMessage {commandId = 5, responseRequired = true, messageId =
> ID:qasus3j4q01-17582-1585567320970-393665:1:1:1:1, originalDestination =
> null, originalTransactionId = null, producerId =
> ID:qasus3j4q01-17582-1585567320970-393665:1:1:1, destination =
> queue://MII_TO_MES_WODCN1, transactionId = null, expiration = 0, timestamp
> =
> 1588928817382, arrival = 0, brokerInTime = 1588929169025, brokerOutTime =
> 1590113149462, correlationId = null, replyTo = null, persistent = true,
> type
> = null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId =
> null, compressed = false, userID = null, content =
> org.apache.activemq.util.ByteSequence@43dda78c, marshalledProperties =
> null,
> dataStructure = null, redeliveryCounter = 0, size = 6741, properties =
> null,
> readOnlyProperties = true, readOnlyBody = true, droppable = false,
> jmsXGroupFirstForConsumer = false}
>
>
>
>
> --
> Sent from:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>

Re: How to access KahaDB db.data in activeMQ-5.15.0 ?

Posted by skao <si...@gmail.com>.
This is exactly what I added in activemq.xml as below.

It only created the header Info instead of the real message body.
It looks exactly the same when I review it in activeMQ console.
No detail message body.


xmlns:camel="http://camel.apache.org/schema/spring"

<bean  id="ActiveMQVMConnectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
		<property name="brokerURL"
value="vm://localhost?create=false&amp;waitForStart=10000"/>
		<property name="userName" value="${activemq.username}"/>
		<property name="password" value="${activemq.password}"/>
	</bean>
	<bean id="activemq"
class="org.apache.activemq.camel.component.ActiveMQComponent" >
		<property name="connectionFactory" ref="ActiveMQVMConnectionFactory"/>
	</bean>
	
	
<camelContext id="camel" trace="false"
xmlns="http://camel.apache.org/schema/spring">
		<route>
			<from
uri="activemq:queue:*?mapJmsMessage=false&amp;selector=CamelFileNameProduced
IS NULL" />
			<choice>
				<when>
					<simple>${in.headers.CamelFileNameProduced} == null</simple>
					<setHeader headerName="CamelJmsDestinationName">
						<simple>${in.header.JMSDestination.physicalName}</simple>
					</setHeader>
					<transform>
						<simple>${in.body}\n</simple>
					</transform> 
					<to
uri="file://data/activemq/?fileExist=Append&amp;fileName=routeMessages-${in.header.JMSDestination.physicalName}-${date:now:yyyyMMdd}.txt"
/>
					<to uri="activemq:dummy" />
				</when>
			</choice>
		</route> 
	</camelContext>


Output : 

ActiveMQObjectMessage {commandId = 5, responseRequired = true, messageId =
ID:qasus3j4q01-17582-1585567320970-393665:1:1:1:1, originalDestination =
null, originalTransactionId = null, producerId =
ID:qasus3j4q01-17582-1585567320970-393665:1:1:1, destination =
queue://MII_TO_MES_WODCN1, transactionId = null, expiration = 0, timestamp =
1588928817382, arrival = 0, brokerInTime = 1588929169025, brokerOutTime =
1590113149462, correlationId = null, replyTo = null, persistent = true, type
= null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId =
null, compressed = false, userID = null, content =
org.apache.activemq.util.ByteSequence@43dda78c, marshalledProperties = null,
dataStructure = null, redeliveryCounter = 0, size = 6741, properties = null,
readOnlyProperties = true, readOnlyBody = true, droppable = false,
jmsXGroupFirstForConsumer = false}




--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: How to access KahaDB db.data in activeMQ-5.15.0 ?

Posted by skao <si...@gmail.com>.
Hi JB,

I have found a article to to backup enqueued messages when you need the body
of messages.

 
https://stackoverflow.com/questions/43625848/how-to-see-dequeued-messages-in-activemq

Here is what I changed in active.xml as below:

xmlns:camel="http://camel.apache.org/schema/spring"
<camelContext id="camel" trace="false"
xmlns="http://camel.apache.org/schema/spring">
		<route>
			<from
uri="activemq:queue:*?mapJmsMessage=false&amp;selector=CamelFileNameProduced
IS NULL" />
			<choice>
				<when>
					<simple>${in.headers.CamelFileNameProduced} == null</simple>
					<setHeader headerName="CamelJmsDestinationName">
						<simple>${in.header.JMSDestination.physicalName}</simple>
					</setHeader>
					<transform>
						<simple>${in.body}\n</simple>
					</transform> 
					<to
uri="file://data/activemq/?fileExist=Append&amp;fileName=routeMessages-${in.header.JMSDestination.physicalName}-${date:now:yyyyMMdd}.txt"
/>
					<to uri="activemq:dummy" />
				</when>
			</choice>
		</route> 
	</camelContext>

It did output the message but only show the header Info not the message
body.
My message body is json format. How to show the message that we produced ?

ActiveMQObjectMessage {commandId = 5, responseRequired = true, messageId =
ID:qasus3j4q01-17582-1585567320970-393665:1:1:1:1, originalDestination =
null, originalTransactionId = null, producerId =
ID:qasus3j4q01-17582-1585567320970-393665:1:1:1, destination =
queue://MII_TO_MES_WODCN1, transactionId = null, expiration = 0, timestamp =
1588928817382, arrival = 0, brokerInTime = 1588929169025, brokerOutTime =
1590113149462, correlationId = null, replyTo = null, persistent = true, type
= null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId =
null, compressed = false, userID = null, content =
org.apache.activemq.util.ByteSequence@43dda78c, marshalledProperties = null,
dataStructure = null, redeliveryCounter = 0, size = 6741, properties = null,
readOnlyProperties = true, readOnlyBody = true, droppable = false,
jmsXGroupFirstForConsumer = false}
ActiveMQObjectMessage {commandId = 5, responseRequired = true, messageId =
ID:qasus3j4q01-17582-1585567320970-512119:1:1:1:1, originalDestination =
null, originalTransactionId = null, producerId =
ID:qasus3j4q01-17582-1585567320970-512119:1:1:1, destination =
queue://MII_TO_MES_WODCN1, transactionId = null, expiration = 0, timestamp =
1589400102298, arrival = 0, brokerInTime = 1589400490488, brokerOutTime =
1590113149463, correlationId = null, replyTo = null, persistent = true, type
= null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId =
null, compressed = false, userID = null, content =
org.apache.activemq.util.ByteSequence@22bbfc2d, marshalledProperties = null,
dataStructure = null, redeliveryCounter = 0, size = 6734, properties = null,
readOnlyProperties = true, readOnlyBody = true, droppable = false,
jmsXGroupFirstForConsumer = false}
ActiveMQObjectMessage {commandId = 5, responseRequired = true, messageId =
ID:qasus3j4q01-17582-1585567320970-512257:1:1:1:1, originalDestination =
null, originalTransactionId = null, producerId =
ID:qasus3j4q01-17582-1585567320970-512257:1:1:1, destination =
queue://MII_TO_MES_WODCN1, transactionId = null, expiration = 0, timestamp =
1589400441696, arrival = 0, brokerInTime = 1589400829913, brokerOutTime =
1590113149465, correlationId = null, replyTo = null, persistent = true, type
= null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId =
null, compressed = false, userID = null, content =
org.apache.activemq.util.ByteSequence@3479f7b2, marshalledProperties = null,
dataStructure = null, redeliveryCounter = 0, size = 6734, properties = null,
readOnlyProperties = true, readOnlyBody = true, droppable = false,
jmsXGroupFirstForConsumer = false}
ActiveMQObjectMessage {commandId = 5, responseRequired = true, messageId =
ID:qasus3j4q01-17582-1585567320970-512259:1:1:1:1, originalDestination =
null, originalTransactionId = null, producerId =
ID:qasus3j4q01-17582-1585567320970-512259:1:1:1, destination =
queue://MII_TO_MES_WODCN1, transactionId = null, expiration = 0, timestamp =
1589400442245, arrival = 0, brokerInTime = 1589400830461, brokerOutTime =
1590113149466, correlationId = null, replyTo = null, persistent = true, type
= null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId =
null, compressed = false, userID = null, content =
org.apache.activemq.util.ByteSequence@3d92a98a, marshalledProperties = null,
dataStructure = null, redeliveryCounter = 0, size = 6459, properties = null,
readOnlyProperties = true, readOnlyBody = true, droppable = false,
jmsXGroupFirstForConsumer = false}

Did you know how to configure the camel object?

Thanks,
Simon






--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: How to access KahaDB db.data in activeMQ-5.15.0 ?

Posted by skao <si...@gmail.com>.
Hi JB,

That is bad news for me.

The only thing that we can do maybe is the mirror queued in activeMQ.

Let me see if I can make it working.

Anyway, thanks a lot for your help.

Regards,
Samuel



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: How to access KahaDB db.data in activeMQ-5.15.0 ?

Posted by Jean-Baptiste Onofre <jb...@nanthrax.net>.
By the way, if you are using queue, a message is dispatched to one and only one consumer (that’s different for topic).

So, your setup is probably not what you want. I would review your use case and setup.

Regards
JB

> Le 21 mai 2020 à 07:17, skao <si...@gmail.com> a écrit :
> 
> Hi JB,
> 
> I would like to see all messages in activeMQ even though they have been
> de-queued by consumers already.
> Our users kept saying that they received duplicate messaged when they
> de-queued the messages.
> I would like to see all messages to confirm it.
> 
> Will the activeMQ console still kept those de-queued messages after the
> messages have been de-queued ?
> 
> Thanks a lot for your outstanding help.
> 
> Regards,
> Samuel
> 
> 
> 
> --
> Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: How to access KahaDB db.data in activeMQ-5.15.0 ?

Posted by Jean-Baptiste Onofre <jb...@nanthrax.net>.
Hi,

You should understand better how ActiveMQ and JMS works.

Once a consumer consumed a message, the message is not in KahaDB anymore.

Regards
JB

> Le 21 mai 2020 à 07:17, skao <si...@gmail.com> a écrit :
> 
> Hi JB,
> 
> I would like to see all messages in activeMQ even though they have been
> de-queued by consumers already.
> Our users kept saying that they received duplicate messaged when they
> de-queued the messages.
> I would like to see all messages to confirm it.
> 
> Will the activeMQ console still kept those de-queued messages after the
> messages have been de-queued ?
> 
> Thanks a lot for your outstanding help.
> 
> Regards,
> Samuel
> 
> 
> 
> --
> Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: How to access KahaDB db.data in activeMQ-5.15.0 ?

Posted by skao <si...@gmail.com>.
Hi JB,

I would like to see all messages in activeMQ even though they have been
de-queued by consumers already.
Our users kept saying that they received duplicate messaged when they
de-queued the messages.
I would like to see all messages to confirm it.

Will the activeMQ console still kept those de-queued messages after the
messages have been de-queued ?

Thanks a lot for your outstanding help.

Regards,
Samuel



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: How to access KahaDB db.data in activeMQ-5.15.0 ?

Posted by Jean-Baptiste Onofre <jb...@nanthrax.net>.
OK, so, regarding your use case, I don’t think it’s a good idea or require to use the exporter.

Just use browse or the web console (http://host:8161/admin <http://host:8161/admin> by default).

You can see all details about messages per destination, if they are persistent or not (so in kahadb or not), etc.

That’s a better approach IMHO.

Regards
JB

> Le 21 mai 2020 à 06:37, skao <si...@gmail.com> a écrit :
> 
> Hi JB,
> 
> Thanks a lot for your help
> .
> Let me try this one below.
> ./bin/export kahadb --source /some/directory/kahadb/ --target
> ~/some/directory/output.xml
> 
> Basically I would like to see the message body from activeMQ in kahadb
> folder and see the detail Info of each message but they are in binary file
> format so hope this output.xml file can show me the detail.
> 
> 
> Thanks,
> Samuel
> 
> 
> 
> 
> 
> 
> 
> --
> Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: How to access KahaDB db.data in activeMQ-5.15.0 ?

Posted by skao <si...@gmail.com>.
Hi JB,

Thanks a lot for your help
.
Let me try this one below.
./bin/export kahadb --source /some/directory/kahadb/ --target
~/some/directory/output.xml

Basically I would like to see the message body from activeMQ in kahadb
folder and see the detail Info of each message but they are in binary file
format so hope this output.xml file can show me the detail.


Thanks,
Samuel







--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: How to access KahaDB db.data in activeMQ-5.15.0 ?

Posted by Jean-Baptiste Onofre <jb...@nanthrax.net>.
ActiveMQ browse doesn’t take kahadb location as argument but directly the destination:

./bin/activemq browse FOO

If you want to extract/dump kahadb, use the kahadb exporter:

./bin/export kahadb --source /some/directory/kahadb/ --target ~/some/directory/output.xml

What’s your use case exactly ?

Regards
JB

> Le 21 mai 2020 à 00:14, skao <si...@gmail.com> a écrit :
> 
> Hi JB,
> 
> This is what I did in the Linux.
> Did I do something wrong to view the db.data file ?
> 
> Please kindly advise.
> 
> Regards,
> Samuel
> 
> cd /home/jboss/apache-activemq-5.15.0/bin
> 
> $ *./activemq browse /hom/jboss/apache-activemq-5.15.0/data/kahadb/db.data*
> INFO: Loading '/home/jboss/apache-activemq-5.15.0//bin/env'
> INFO: Using java '/usr/java/jdk1.8.0_144/bin/java'
> Java Runtime: Oracle Corporation 1.8.0_144 /usr/java/jdk1.8.0_144/jre
>  Heap sizes: current=62976k  free=61992k  max=932352k
>    JVM args: -Xms64M -Xmx1G
> -Djava.util.logging.config.file=logging.properties
> -Djava.security.auth.login.config=/home/jboss/apache-activemq-5.15.0//conf/login.config
> -Dactivemq.classpath=/home/jboss/apache-activemq-5.15.0//conf:/home/jboss/apache-activemq-5.15.0//../lib/:
> -Dactivemq.home=/home/jboss/apache-activemq-5.15.0/
> -Dactivemq.base=/home/jboss/apache-activemq-5.15.0/
> -Dactivemq.conf=/home/jboss/apache-activemq-5.15.0//conf
> -Dactivemq.data=/home/jboss/apache-activemq-5.15.0//data
> Extensions classpath:
> 
> [/home/jboss/apache-activemq-5.15.0/lib,/home/jboss/apache-activemq-5.15.0/lib/camel,/home/jboss/apache-activemq-5.15.0/lib/optional,/home/jboss/apache-activemq-5.15.0/lib/web,/home/jboss/apache-activemq-5.15.0/lib/extra]
> ACTIVEMQ_HOME: /home/jboss/apache-activemq-5.15.0
> ACTIVEMQ_BASE: /home/jboss/apache-activemq-5.15.0
> ACTIVEMQ_CONF: /home/jboss/apache-activemq-5.15.0/conf
> ACTIVEMQ_DATA: /home/jboss/apache-activemq-5.15.0/data
> 
> 
> 
> 
> --
> Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: How to access KahaDB db.data in activeMQ-5.15.0 ?

Posted by skao <si...@gmail.com>.
Got error when I tried to browse the queue in activeMQ.

activemq browse --amqurl tcp://xxxxxxxxxxxxx:61616 MESF_TO_MII_CFR

INFO: Loading '/home/jboss/apache-activemq-5.15.0//bin/env'
INFO: Using java '/usr/java/jdk1.8.0_144/bin/java'
Java Runtime: Oracle Corporation 1.8.0_144 /usr/java/jdk1.8.0_144/jre
  Heap sizes: current=62976k  free=61992k  max=932352k
    JVM args: -Xms64M -Xmx1G
-Djava.util.logging.config.file=logging.properties
-Djava.security.auth.login.config=/home/jboss/apache-activemq-5.15.0//conf/login.config
-Dactivemq.classpath=/home/jboss/apache-activemq-5.15.0//conf:/home/jboss/apache-activemq-5.15.0//../lib/:
-Dactivemq.home=/home/jboss/apache-activemq-5.15.0/
-Dactivemq.base=/home/jboss/apache-activemq-5.15.0/
-Dactivemq.conf=/home/jboss/apache-activemq-5.15.0//conf
-Dactivemq.data=/home/jboss/apache-activemq-5.15.0//data
Extensions classpath:
 
[/home/jboss/apache-activemq-5.15.0/lib,/home/jboss/apache-activemq-5.15.0/lib/camel,/home/jboss/apache-activemq-5.15.0/lib/optional,/home/jboss/apache-activemq-5.15.0/lib/web,/home/jboss/apache-activemq-5.15.0/lib/extra]
ACTIVEMQ_HOME: /home/jboss/apache-activemq-5.15.0
ACTIVEMQ_BASE: /home/jboss/apache-activemq-5.15.0
ACTIVEMQ_CONF: /home/jboss/apache-activemq-5.15.0/conf
ACTIVEMQ_DATA: /home/jboss/apache-activemq-5.15.0/data
INFO: Failed to execute browse task.
ERROR: java.lang.reflect.InvocationTargetException
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at
org.apache.activemq.console.filter.MapTransformFilter.transformElement(MapTransformFilter.java:68)
        at
org.apache.activemq.console.filter.ResultTransformFilter.transformList(ResultTransformFilter.java:67)
        at
org.apache.activemq.console.filter.ResultTransformFilter.query(ResultTransformFilter.java:43)
        at
org.apache.activemq.console.filter.PropertiesViewFilter.query(PropertiesViewFilter.java:52)
        at
org.apache.activemq.console.filter.PropertiesViewFilter.query(PropertiesViewFilter.java:52)
        at
org.apache.activemq.console.util.AmqMessagesUtil.filterMessagesView(AmqMessagesUtil.java:64)
        at
org.apache.activemq.console.command.AmqBrowseCommand.runTask(AmqBrowseCommand.java:151)
        at
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63)
        at
org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:154)
        at
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:63)
        at
org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.activemq.console.Main.runTaskClass(Main.java:262)
        at org.apache.activemq.console.Main.main(Main.java:115)
Caused by: javax.jms.JMSException: Failed to build body from content.
Serializable class not available to broker. Reason:
java.lang.ClassNotFoundException:
com.rockwell.integration.messaging.MessageEnvelope
        at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:36)
        at
org.apache.activemq.command.ActiveMQObjectMessage.getObject(ActiveMQObjectMessage.java:208)
        at
org.apache.activemq.console.filter.MapTransformFilter.transformToMap(MapTransformFilter.java:188)
        ... 21 more
Caused by: java.lang.ClassNotFoundException:
com.rockwell.integration.messaging.MessageEnvelope
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:348)
        at
org.apache.activemq.util.ClassLoadingAwareObjectInputStream.load(ClassLoadingAwareObjectInputStream.java:142)
        at
org.apache.activemq.util.ClassLoadingAwareObjectInputStream.resolveClass(ClassLoadingAwareObjectInputStream.java:56)
        at
java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1826)
        at
java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1713)
        at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2000)
        at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:422)
        at
org.apache.activemq.command.ActiveMQObjectMessage.getObject(ActiveMQObjectMessage.java:206)
        ... 22 more



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: How to access KahaDB db.data in activeMQ-5.15.0 ?

Posted by skao <si...@gmail.com>.
Hi JB,

This is what I did in the Linux.
Did I do something wrong to view the db.data file ?

Please kindly advise.

Regards,
Samuel

cd /home/jboss/apache-activemq-5.15.0/bin

$ *./activemq browse /hom/jboss/apache-activemq-5.15.0/data/kahadb/db.data*
INFO: Loading '/home/jboss/apache-activemq-5.15.0//bin/env'
INFO: Using java '/usr/java/jdk1.8.0_144/bin/java'
Java Runtime: Oracle Corporation 1.8.0_144 /usr/java/jdk1.8.0_144/jre
  Heap sizes: current=62976k  free=61992k  max=932352k
    JVM args: -Xms64M -Xmx1G
-Djava.util.logging.config.file=logging.properties
-Djava.security.auth.login.config=/home/jboss/apache-activemq-5.15.0//conf/login.config
-Dactivemq.classpath=/home/jboss/apache-activemq-5.15.0//conf:/home/jboss/apache-activemq-5.15.0//../lib/:
-Dactivemq.home=/home/jboss/apache-activemq-5.15.0/
-Dactivemq.base=/home/jboss/apache-activemq-5.15.0/
-Dactivemq.conf=/home/jboss/apache-activemq-5.15.0//conf
-Dactivemq.data=/home/jboss/apache-activemq-5.15.0//data
Extensions classpath:
 
[/home/jboss/apache-activemq-5.15.0/lib,/home/jboss/apache-activemq-5.15.0/lib/camel,/home/jboss/apache-activemq-5.15.0/lib/optional,/home/jboss/apache-activemq-5.15.0/lib/web,/home/jboss/apache-activemq-5.15.0/lib/extra]
ACTIVEMQ_HOME: /home/jboss/apache-activemq-5.15.0
ACTIVEMQ_BASE: /home/jboss/apache-activemq-5.15.0
ACTIVEMQ_CONF: /home/jboss/apache-activemq-5.15.0/conf
ACTIVEMQ_DATA: /home/jboss/apache-activemq-5.15.0/data




--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: How to access KahaDB db.data in activeMQ-5.15.0 ?

Posted by Jean-Baptiste Onofre <jb...@nanthrax.net>.
Hi,

Basically you can do bin/activemq browse FOO

Where FOO is the destination name.

Regards
JB

> Le 20 mai 2020 à 18:16, skao <si...@gmail.com> a écrit :
> 
> Hi JB,
> 
> I never used bin/activemq browse before but I could Google it a little bit.
> 
> Thanks a lot.
> 
> Regards,
> Samuel
> 
> 
> 
> --
> Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: How to access KahaDB db.data in activeMQ-5.15.0 ?

Posted by skao <si...@gmail.com>.
Hi JB,

I never used bin/activemq browse before but I could Google it a little bit.

Thanks a lot.

Regards,
Samuel



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: How to access KahaDB db.data in activeMQ-5.15.0 ?

Posted by Jean-Baptiste Onofre <jb...@nanthrax.net>.
Hi,

It’s not really steps, it’s more "alternative".

For instance, you can use bin/activemq browse.

Regards
JB

> Le 20 mai 2020 à 16:36, skao <si...@gmail.com> a écrit :
> 
> Hi JB,
> 
> Thanks a lot for your help.
> Could you be more specific on these steps below ?
> For instance, how to use the bin/activemq script ?
> 
> Thansk,
> Samuel
> 
> 1. Use JMX to browse the queue (directly or via REST thanks to Jolokia)
> 2. Use admin console
> 3. Use any client (including REST) to browse
> 4. Use jms:* command in Karaf
> 5. Dump kahadb or browse content using bin/activemq (browse, …) script
> 
> 
> 
> --
> Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: How to access KahaDB db.data in activeMQ-5.15.0 ?

Posted by skao <si...@gmail.com>.
Hi JB,

Thanks a lot for your help.
Could you be more specific on these steps below ?
For instance, how to use the bin/activemq script ?

Thansk,
Samuel

1. Use JMX to browse the queue (directly or via REST thanks to Jolokia)
2. Use admin console
3. Use any client (including REST) to browse
4. Use jms:* command in Karaf
5. Dump kahadb or browse content using bin/activemq (browse, …) script



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: How to access KahaDB db.data in activeMQ-5.15.0 ?

Posted by Jean-Baptiste Onofre <jb...@nanthrax.net>.
Hi,

You can:

1. Use JMX to browse the queue (directly or via REST thanks to Jolokia)
2. Use admin console
3. Use any client (including REST) to browse
4. Use jms:* command in Karaf
5. Dump kahadb or browse content using bin/activemq (browse, …) script

Generally speaking, we never manipulate kahadb directly as it’s a specific database we did for ActiveMQ (so not "human readable").

Regards
JB

> Le 20 mai 2020 à 07:39, skao <si...@gmail.com> a écrit :
> 
> Hi All,
> 
> I would like to view the KahaDB db.data to check the detail of enqueue
> message body.
> But it is binary file format.
> 
> Is there any tool to open the KahaDB db.data file or how to convert it to
> txt file ?
> 
> Please kindly help.
> 
> Sincerely,
> Samuel
> 
> 
> 
> 
> --
> Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: How to access KahaDB db.data in activeMQ-5.15.0 ?

Posted by skao <si...@gmail.com>.
Hi JB,

Thanks a lot for the reply.

We are thinking about the mirror queued to get all the en-queued messages
from producer and not consumed it.
It is working fine so far but it is kind of risky if we kept those mirror
messages in activeMQ without consuming them which might crash the activeMQ
server eventually.

The consumer was called from other team which we can't modify any code to
de-queued messages.

Need to think about adding plug-in in activeMQ to redirect those messages to
file location or something which is safety.

Thanks,
Simon










--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: How to access KahaDB db.data in activeMQ-5.15.0 ?

Posted by Tim Bain <tb...@alumni.duke.edu>.
Also, to state the obvious, depending on the load on your broker this could
be a massive amount of logging. Be sure you configure your logging system
appropriately (log roll-over in place, a sufficiently large disk to store
the volume of logs at the point where they start to roll over, etc.).

Tim

On Thu, May 21, 2020, 5:59 AM Tim Bain <tb...@alumni.duke.edu> wrote:

> You could write a plugin that would log the content of each message as
> it's received; just log it and then call the corresponding
> super.messageDelivered() method. Relevant information is at
> https://activemq.apache.org/interceptors and
> https://activemq.apache.org/developing-plugins.
>
> Tim
>
> On Thu, May 21, 2020, 1:09 AM Jean-Baptiste Onofre <jb...@nanthrax.net>
> wrote:
>
>> Not directly. You can always use advisory to be notify when a message is
>> consumed.
>>
>> But again, once it has been consumed, the message is gone.
>>
>> Regards
>> JB
>>
>> > Le 21 mai 2020 à 09:05, skao <si...@gmail.com> a écrit :
>> >
>> > Hi François,
>> >
>> > Thanks a lot for your reply.
>> >
>> > Like JB mention earlier, if the consumer de-queue the message and then
>> it
>> > won't show up in kahaDB.
>> > Then there is no way for me to see the hahadb file to review the
>> en-queue
>> > messages.
>> >
>> > I would like to see all messages even though they have been de-queued by
>> > consumers.
>> >
>> > Is that possible ?
>> >
>> > Thanks,
>> > Samuel
>> >
>> >
>> >
>> >>> Hi,
>> >
>> >>> You should understand better how ActiveMQ and JMS works.
>> >
>> >>> Once a consumer consumed a message, the message is not in KahaDB
>> anymore.
>> >
>> >>> Regards
>> >>> JB
>> >
>> >
>> >
>> > --
>> > Sent from:
>> http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>>
>>

Re: How to access KahaDB db.data in activeMQ-5.15.0 ?

Posted by skao <si...@gmail.com>.
Hi Tim,

I will review these link below and get an idea of these solution.

https://activemq.apache.org/interceptors and
https://activemq.apache.org/developing-plugins.

Thanks a lot for your help.

Thansk,
Simon



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: How to access KahaDB db.data in activeMQ-5.15.0 ?

Posted by Tim Bain <tb...@alumni.duke.edu>.
You could write a plugin that would log the content of each message as it's
received; just log it and then call the corresponding
super.messageDelivered() method. Relevant information is at
https://activemq.apache.org/interceptors and
https://activemq.apache.org/developing-plugins.

Tim

On Thu, May 21, 2020, 1:09 AM Jean-Baptiste Onofre <jb...@nanthrax.net> wrote:

> Not directly. You can always use advisory to be notify when a message is
> consumed.
>
> But again, once it has been consumed, the message is gone.
>
> Regards
> JB
>
> > Le 21 mai 2020 à 09:05, skao <si...@gmail.com> a écrit :
> >
> > Hi François,
> >
> > Thanks a lot for your reply.
> >
> > Like JB mention earlier, if the consumer de-queue the message and then it
> > won't show up in kahaDB.
> > Then there is no way for me to see the hahadb file to review the en-queue
> > messages.
> >
> > I would like to see all messages even though they have been de-queued by
> > consumers.
> >
> > Is that possible ?
> >
> > Thanks,
> > Samuel
> >
> >
> >
> >>> Hi,
> >
> >>> You should understand better how ActiveMQ and JMS works.
> >
> >>> Once a consumer consumed a message, the message is not in KahaDB
> anymore.
> >
> >>> Regards
> >>> JB
> >
> >
> >
> > --
> > Sent from:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>
>

Re: How to access KahaDB db.data in activeMQ-5.15.0 ?

Posted by Jean-Baptiste Onofre <jb...@nanthrax.net>.
Not directly. You can always use advisory to be notify when a message is consumed.

But again, once it has been consumed, the message is gone.

Regards
JB

> Le 21 mai 2020 à 09:05, skao <si...@gmail.com> a écrit :
> 
> Hi François,
> 
> Thanks a lot for your reply.
> 
> Like JB mention earlier, if the consumer de-queue the message and then it
> won't show up in kahaDB.
> Then there is no way for me to see the hahadb file to review the en-queue
> messages.
> 
> I would like to see all messages even though they have been de-queued by
> consumers.
> 
> Is that possible ?
> 
> Thanks,
> Samuel
> 
> 
> 
>>> Hi,
> 
>>> You should understand better how ActiveMQ and JMS works.
> 
>>> Once a consumer consumed a message, the message is not in KahaDB anymore.
> 
>>> Regards
>>> JB
> 
> 
> 
> --
> Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: How to access KahaDB db.data in activeMQ-5.15.0 ?

Posted by skao <si...@gmail.com>.
Hi François,

Thanks a lot for your reply.

Like JB mention earlier, if the consumer de-queue the message and then it
won't show up in kahaDB.
Then there is no way for me to see the hahadb file to review the en-queue
messages.

I would like to see all messages even though they have been de-queued by
consumers.

Is that possible ?

Thanks,
Samuel



>>Hi,

>>You should understand better how ActiveMQ and JMS works.

>>Once a consumer consumed a message, the message is not in KahaDB anymore.

>>Regards
>>JB



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: How to access KahaDB db.data in activeMQ-5.15.0 ?

Posted by Francois Papon <fr...@openobject.fr>.
Hi,

Yes I was talking about the Webconsole.

You just have to configure your ActiveMQ instance to the kahadb location
in the conf/activemq.xml

regards,

François
fpapon@apache.org

Le 21/05/2020 à 04:47, skao a écrit :
> Hi François,
>
> Are you talking about the ActiveMQ console ? 
> If not, could you please explain the detail of how to use Webconsole t open
> the KahaDB db.data file ?
>
> Thansk,
> Simon
>
>
>
> --
> Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: How to access KahaDB db.data in activeMQ-5.15.0 ?

Posted by skao <si...@gmail.com>.
Hi François,

Are you talking about the ActiveMQ console ? 
If not, could you please explain the detail of how to use Webconsole t open
the KahaDB db.data file ?

Thansk,
Simon



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: How to access KahaDB db.data in activeMQ-5.15.0 ?

Posted by Francois Papon <fr...@openobject.fr>.
Hi,

You can use the Webconsole to show the messages.

regards,

François
fpapon@apache.org

Le 20/05/2020 à 07:39, skao a écrit :
> Hi All,
>
> I would like to view the KahaDB db.data to check the detail of enqueue
> message body.
> But it is binary file format.
>
> Is there any tool to open the KahaDB db.data file or how to convert it to
> txt file ?
>
> Please kindly help.
>
> Sincerely,
> Samuel
>
>
>
>
> --
> Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html