Thank you for your reply!  Here is what I have on the Java side (ActiveMQ is
embedded within JBOSS btw:)

ConnectionFactory cf1 = (ConnectionFactory)
ctx.lookup("TopicConnectionFactory");
Connection connection = cf1.createConnection();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
Destination dest = (Topic) ctx.lookup("topic/SciTegic");
MessageProducer producer = session.createProducer(dest);
TextMessage msg = session.createTextMessage("TEST MESSAGE FOR MDB");

On the C++ side:
ActiveMQConnectionFactory* connectionFactory = new
ActiveMQConnectionFactory("tcp://127.0.0.1:61616?wireFormat=openwire&transport.useAsyncSend=true");

connection = connectionFactory->createConnection();
connection->start();
delete connectionFactory;
session = connection->createSession( Session::AUTO_ACKNOWLEDGE );


destination = session->createTopic( "TOPIC.SciTegic" ); // IS THIS THE RIGHT
NAME TO USE? 

 producer = session->createProducer( destination );
 producer->setDeliveryMode( DeliveryMode::NON_PERSISTENT );
string threadIdStr = Integer::toString( Thread::getId() );
 string text = (string)"Hello world! from thread " + threadIdStr;
TextMessage* message = session->createTextMessage( text );
 producer->send( message );
delete message;

Thanks again for all the help, this is driving me crazy!



tabish121 wrote:
> 
> You send the messages to a Destination with the same name as the one
> you've configured your MDB to listen on.  
> 
> regards
> Tim
> 
> On Wed, 2007-06-06 at 10:53 -0700, alexvs wrote:
>> Hi guys,
>> 
>> I need help!  I have two extra days to finish this project and I can't
>> figure out how to make my C++ client send messages to ActiveMQ and have
>> these messages delivered to my MDB.  I have the example running in C++,
>> but
>> I don't know how to locate the JMS topic or connection that would route
>> to
>> my MDB.
>> 
>> Any help would be greatly appreciated!
>> 
>> Thanks.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Integrating-C%2B%2B-Client-with-MDB-tf3879413s2354.html#a10995054
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to