This content has been marked as final. Show 6 replies
The default implementation of onMessage() is as below:
public void onMessage(Message message)
Guess you are overloading onMessage(), in this case you might have to manually call onMessage() method. It will not be invoked by container.
Please let me know, if its correct.
There are two common possibilities:
1: Messages won't be delivered to a receiver until you call "start()" on the connection you used to create the receiver's session.
2: Topic subscriptions will not receive any messages that are sent before the subscription was created.
There's sample onMessage code in the edocs:
Thanks for your response. I am using the exact sample code that you have shared.
It has the start method to instantiate the connection.
About the second point you mention.. I am not sure how to implement the wait functionality in .Net. I was hoping to implement a polling mechanism, i.e. a service continually hitting the Topic to check for messages.
Was trying to work on the sample code provided by Oracle. So was wondering what is going wrong.
This is the first time I've ever heard of the sample silently failing, and the sample has been in place for 5 years now. It's odd that you can get a synchronous topic consumer to work, but not an asynchronous consumer.
I only have a few ideas what might be going wrong. Perhaps your environment is somehow very very slow, so the sample gives up and finishes before the message can arrive - try increasing the Sleep time to 10000 millis from 1000 in the sample. Perhaps there's some sort of uncaught exception being pushed to the client: modify the test code to have an "OnException" listener, register this listener with the connection, and have the listener print any exceptions that it gets. Perhaps there's some sort of problem on the server: check your server logs.
Is there anything different about your environment? Which version of .NET are you using? What's the tuning of your Topic? (Did you turn it into a distributed topic?) Of WebLogic?
I am not sure how to implement the wait functionality in .Net. I was hoping to implement a polling mechanism, i.e. a service continually hitting the Topic to check for messages.I haven't worked with .NET in a while, so I don't recall it's thread handling verbs. There should be no need for polling once you get the asynchronous consumer to work.
In first place, for sure we can not help on .Net stuff, coming to the MDB part.
Could you please let us know, what exactly you did from starting, with the samples provided by Tom.
Am concerned that, it could be understanding issue too. So if you can provide us the detailed process you followed to work with the the files, probably we can get a clue on where the things going wrong/ if everything is in place. Don't hesitate to put even compiling the classes and creating JMS resources.