I have configured my Topic in jbossmq-destinations-service.xml as follows:
<mbean code="org.jboss.mq.server.jmx.Topic"
name="jboss.mq.destination:service=Topic,name=myTopicName">
<depends optional-attribute-name="DestinationManager">
jboss.mq:service=DestinationManager</depends>
<depends optional-attribute-name="SecurityManager">
jboss.mq:service=SecurityManager</depends>
<attribute name="SecurityConf">
<security>
<role name="guest" read="true" write="true" create="true"/>
<role name="publisher" read="true" write="true" create="false"/>
<role name="durpublisher" read="true" write="true" create="true"/>
</security>
</attribute>
</mbean>
I can easily connect to the topic to publish messages by doing a JNDI lookup on the topic name and everything works fine.
However, I want to be able to clear the messages at certain intervals since they may become out of date depending on some other system functionality but I can't find any examples or explanations of how to do this.
The problem is that when I do a JNDI lookup on the topic it returns a org.jboss.mq.SpyTopic which does not have any functionality for removing messages or even to find out how many messages are on the topic. All the examples seem to suggest that org.jboss.mq.server.JMSTopic has all the functionality but I can't figure out how to convert a SpyTopic to a JMSTopic or how to set up the topic so that the JNDI lookup will return a JMSTopic.
Can anyone help?
Thanks.