[
http://jira.jboss.com/jira/browse/JBAS-1547?page=comments#action_12315934 ]
Adrian Brock commented on JBAS-1547:
------------------------------------
Your test is unusable as it stands since it includes references to code you
have not posted.
Attached is a simplified version of the test that can be run against a
raw JBoss installation. Client.java
and a server.log with the extra logging configured in conf/log4j.xml
<category name="org.jboss.mq">
<priority value="TRACE" class="org.jboss.logging.XLevel"/>
</category>
<category name="org.jboss.mq.il">
<priority value="INFO"/>
</category>
This shows the messages getting deleted:
005-03-07 17:39:56,902 DEBUG [org.jboss.mq.sm.jdbc.JDBCStateManager] Removing
subscription.
2005-03-07 17:39:56,902 TRACE [org.jboss.mq.server.BasicQueue]
removeAllMessages [EMAIL PROTECTED] name=testing selector=null]}
2005-03-07 17:39:56,903 TRACE [org.jboss.mq.server.BasicQueue] dropMessage
[EMAIL PROTECTED] name=testing selector=null]} txid=null
2005-03-07 17:39:56,903 TRACE [org.jboss.mq.pm.jdbc2.PersistenceManager]
Removing message 1 msg=0 hard STORED PERSISTENT
queue=TOPIC.testTopic.DurableSubscription[clientId=DurableSubscriberExample
name=testing selector=null] priority=4 lateClone=false hashCode=30968863
transaction=null
2005-03-07 17:39:56,910 TRACE [org.jboss.mq.pm.jdbc2.PersistenceManager]
Removed message 1 msg=0 hard REMOVED PERSISTENT
queue=TOPIC.testTopic.DurableSubscription[clientId=DurableSubscriberExample
name=testing selector=null] priority=4 lateClone=false hashCode=30968863
transaction=null
2005-03-07 17:39:56,913 TRACE [org.jboss.mq.server.TracingInterceptor] RETURN :
destroySubscription
> Session.unsubscribe does not clear JMS messages from the database
> -----------------------------------------------------------------
>
> Key: JBAS-1547
> URL: http://jira.jboss.com/jira/browse/JBAS-1547
> Project: JBoss Application Server
> Type: Bug
> Components: JMS service
> Versions: JBossAS-4.0.1 Final
> Environment: Windows XP
> JDK 1.5.0
> MS SQL Server
> Reporter: Plamen Todorov
> Assignee: Adrian Brock
> Attachments: Client.java, server.log
>
>
> I am testing durable topic subscription and have the following issue:
> session.unsubscribe("") clears the subscription from the database, but does
> not clear the JMS messages stored for this subscription from the JMS_MESSAGES
> table. I am using MS SQL Server 2000 to store the messages. Here is my test
> code:
> public Result testTopic(TopicJMSPerformanceTestSetup setup){
> try{
> boolean guaranteed = setup.isGuaranteed();
> long t = System.currentTimeMillis();
> log("Testing " + (guaranteed ? " guaranteed" : " non-guaranteed")
> + " topic connection delivery...");
> TopicConnectionFactory factory =
> connector.getTopicConnectionFactory();
> TopicConnection conn;
> try{
> conn = factory.createTopicConnection(
> connector.getJMSProperty(ContextJMSConnector.JMS_PROPERTY_CONNECTION_USERNAME),
>
> connector.getJMSProperty(ContextJMSConnector.JMS_PROPERTY_CONNECTION_PASSWORD));
> log("Connected as " +
> connector.getJMSProperty(ContextJMSConnector.JMS_PROPERTY_CONNECTION_USERNAME)
> + " Topic connection: " + conn);
> }catch(JMSConnectorException ex){
> conn = factory.createTopicConnection();
> log("Connected using the default user credentials. Topic
> connection: " + conn);
> }
> conn.start();
> try{
> log("Topic connection: " + conn);
> TopicSession session = conn.createTopicSession(false,
> Session.AUTO_ACKNOWLEDGE);
> log("Topic session: " + session);
> int mode = (guaranteed ? DeliveryMode.PERSISTENT :
> DeliveryMode.NON_PERSISTENT);
> TopicPublisher publisher =
> session.createPublisher(connector.getTopic(TOPIC_INTERNAL_NAME));
> publisher.setDeliveryMode(mode);
> log("Message publisher: " + publisher);
> TopicSubscriber subscriber = null;
> if(guaranteed)
> subscriber =
> session.createDurableSubscriber(connector.getTopic(TOPIC_INTERNAL_NAME),
> "testDurableSubscriber");
> else
> subscriber =
> session.createSubscriber(connector.getTopic(TOPIC_INTERNAL_NAME));
> long objectCreationTime = System.currentTimeMillis() - t;
> log("Message subscriber: " + subscriber);
> //flush topic messages
> log("Clearing " + empty(subscriber) + " messages from the
> test topic." );
> long messageSendingTime = 0;
> try{
> log("Publishing/receiving " + setup.getIterations() +
> (guaranteed? " persistent" : " non-persistent") + " messages, Size = " +
> setup.getMessageSize() + " bytes...");
> messageSendingTime = work(publisher, subscriber, session,
> setup);
> }finally{
> try{
> subscriber.close();
> publisher.close();
> }finally{
> if(guaranteed)
> session.unsubscribe("testDurableSubscriber");
> }
> session.close();
> }
> log("Message publishing finished. Time: " +
> messageSendingTime + " msec\n");
> return new PerformanceResult(setup, objectCreationTime,
> messageSendingTime);
> }finally{
> conn.close();
> }
> }catch(Exception e){
> String message = "ERROR!\nError executing test. Message: " + e +
> "\nTest setup: " + setup + "\nTime: " +
> SimpleDateFormat.getTimeInstance().format(new Date());
> log(message + "\n", Level.ERROR);
> e.printStackTrace();
> return new ResultImpl(message);
> }
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-Development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-development