activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sheetal Kulkarni <Sheetal.Kulka...@sungard.com>
Subject RE: ActiveMq persistence in xml
Date Tue, 27 Dec 2011 13:55:42 GMT
Hi,

Thanks a lot, I am trying for the 3rd point. Seeing messages in database as 'String' and not
binary data.
However now I am getting exception as below:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creati
ng bean with name 'org.apache.activemq.xbean.XBeanBrokerService#0' defined in cl
ass path resource [activemq.xml]: Invocation of init method failed; nested excep
tion is java.io.IOException: Frame size of 771 MB larger than max allowed 100 MB

        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.initializeBean(AbstractAutowireCapableBeanFactory.java:1412)

And my piece of code is as below:
class MyJdbcAdapter extends DefaultJDBCAdapter{
     protected byte [] getBinaryData(ResultSet rs, int index)throws SQLException{
       try{
             System.out.println("#########get binary data called##########");
             String data = rs.getString(index);
             return data.getBytes();

       }catch(Exception e){
             throw new SQLException("Error reading binary data");
       }
     }

     protected void setBinaryData(PreparedStatement s, int index , byte[] data) throws SQLException{
       System.out.println("#########set binary data called##########");
       s.setString(index, new String(data));
       System.out.println(new String(data));
       System.out.println("#########after setting the string#######");
     }
}

It fails for 'getBinaryData' call.

Thanks,
Sheetal
From: Yuvaraj Vanarase [via ActiveMQ] [mailto:ml-node+s2283324n4236969h30@n4.nabble.com]
Sent: Tuesday, December 27, 2011 5:41 PM
To: Kulkarni, Sheetal
Subject: RE: ActiveMq persistence in xml

Not clearly understood the requirement. However--

1. if you would like to see message contents (readable I would say), let say using web console
of activemq, then just clicking on message does that provided toString() method implemented
accordingly for that class
2. if you would like to display the content to user/client in XML format..then offcourse object
can be represented as XML using DOM or even Loggers do that e.g. log4j/logback
3. If you want to show someone, the object stored in DB(e.g. object stored as XMLType in Oracle),
then you might have to override default behavior of JDBCAdapter to control the read/write
for specific DB
http://activemq.apache.org/maven/5.3.1/activemq-core/apidocs/org/apache/activemq/store/jdbc/adapter/DefaultJDBCAdapter.html

hope this helps!

Regards,
Yuvaraj


-----Original Message-----
From: Sheetal Kulkarni [mailto:[hidden email]</user/SendEmail.jtp?type=node&node=4236969&i=0>]
Sent: Tuesday, December 27, 2011 5:04 PM
To: [hidden email]</user/SendEmail.jtp?type=node&node=4236969&i=1>
Subject: ActiveMq persistence in xml

Hi,

Does anyone knows how i can store the activemq messages in form of xml?
Currently it stores messages as binary in database, i want to have a
application which reads messages from database and show some analysis of
those messages.

Please comment.
Sheetal

--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMq-persistence-in-xml-tp4236892p4236892.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

________________________________
If you reply to this email, your message will be added to the discussion below:
http://activemq.2283324.n4.nabble.com/ActiveMq-persistence-in-xml-tp4236892p4236969.html
To unsubscribe from ActiveMq persistence in xml, click here<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4236892&code=U2hlZXRhbC5LdWxrYXJuaUBzdW5nYXJkLmNvbXw0MjM2ODkyfDg0MDQzMzA0OA==>.
NAML<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.InstantMailNamespace&breadcrumbs=instant+emails%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>


--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMq-persistence-in-xml-tp4236892p4237129.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message