is it possible to get kind of notification on the message producer side, that new subscriber joined to the topic? In particular, is it possible with JBoss Messaging?
Topic subscribers (consumers) are stored in a private field inside JBoss' TopicSession implementation (JBMSession). None of those classes provides an access method to that field, so without hacking (reflection) I see no way to solve that problem.
But if you can use reflection and do not mind using it, maybe the following strategy comes close to what you want:
implement a JBMSessionObserver for the TopicSession. This class will reflect the private Set of consumers, track changes periodically (like every 1 second or so) and notify registered listeners by sending events.
implement JBMSessionObserverListener(s), register them with the JBMSessionObserver to receive change events.
The next problem you'll encounter is, that the JBMSession only stores MessageListeners and doesn't know the owner of the Listener. Listeners do not have unique keys or names. They just provide a method to process an message.
So you may be able to get the information that a new listener has joined but you may not be able to identify the real consumer behind the listener.