I wrote a test case to test the JMSAppender class using ActiveMQ, that might be a useful baseline.

See the test case and jndi.properties file attached to this bug:

http://issues.apache.org/bugzilla/show_bug.cgi?id=38513

I was using ActiveMQ 3.2.x at the time, but it should be close to that.

cheers,

Paul

On 27/06/2007, at 2:12 AM, Misty Thornton wrote:

Hello Guru's,

I am trying to use the JMSAppender to send messages to a topic in ActiveMQ environment. I have never done this before and have proceeded to this point
and want to know if I am in the right direction...:).

Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

Destination destination = session.createTopic("YARDI.TOPIC1");
MessageProducer producer = session.createProducer(destination);
producer.setTimeToLive(10000);
producer.setDeliveryMode(DeliveryMode.PERSISTENT);

String text = "Hello world! From, please go to jConsole and let me see you
there..:)";
logger.info("Go to Yardi Topic.");
log4j.JMSAppender myappender = new JMSAppender();
//want to append messages to my topic here..I guess..

TextMessage message = session.createTextMessage(text);
producer.send(message);

session.close();
connection.close();

I would really appreciate it if somebody could point me in the right
direction. I am able to send simple text messages to the 'topic' that I have
created. I want to send my log messages produced by the logger to the
'topic'.

Any help will be much appreciated,
TIA.

Misty.

Paul Smith
Core Engineering Manager

Aconex
The easy way to save time and money on your project

696 Bourke Street, Melbourne,
VIC 3000, Australia
Tel: +61 3 9240 0200  Fax: +61 3 9240 0299
Email: [EMAIL PROTECTED]  www.aconex.com

This email and any attachments are intended solely for the addressee. The contents may be privileged, confidential and/or subject to copyright or other applicable law. No confidentiality or privilege is lost by an erroneous transmission. If you have received this e-mail in error, please let us know by reply e-mail and delete or destroy this mail and all copies. If you are not the intended recipient of this message you must not disseminate, copy or take any action in reliance on it. The sender takes no responsibility for the effect of this message upon the recipient's computer system.



Reply via email to