qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mahmoud Parsian <mpars...@yahoo.com>
Subject putting a message into a defined queue (created by a qpid server at startup time)
Date Mon, 09 May 2011 22:33:56 GMT
Hello all,

I posted my question in a wrong thread, so I am posting it here again (sorry about this!).

I am using qpid-0.10 (Java with BDB persistence for messages). I define a single queue (it's
name is: testqueue -- definition is given below), which is created at server start up time.
Then I put 2 messages into this queue (code is given below), but it seems that my messages
are not put there, but put in qpid store (somewhere!). When I restart the server, the log
file indicates that:
 "Message id 1 in store, but not in any queue - removing...."
 "Message id 2 in store, but not in any queue - removing...."

What is the proper way of putting messages into specific queues? I am using the following
to designate my testqueue (complete code is given below):

        Destination queue = new AMQAnyDestination("ADDR:message_testqueue; {create: always,
node-properties: {durable: true}}");


Many thanks in advance.
best,
Mahmoud

=== code which puts messages into a queue ---- (I want to put into "testqueue" defined in
virtualhosts.xml file which I point to) ===

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.jms.Connection;
import javax.jms.Destination;
import javax.jms.MapMessage;
import javax.jms.MessageProducer;
import javax.jms.Session;
import org.apache.qpid.client.AMQAnyDestination;
import org.apache.qpid.client.AMQConnection;

public class MapSender {

    public static void main(String[] args) throws Exception {
        Connection connection =  new AMQConnection("amqp://guest:guest@test/?brokerlist='tcp://dhcp45.nextbiosystem.com:5672'");
        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        Destination queue = new AMQAnyDestination("ADDR:message_testqueue; {create: always,
node-properties: {durable: true}}"); 
        MessageProducer producer = session.createProducer(queue);

        MapMessage m = session.createMapMessage();
        m.setIntProperty("Id", 987654321);
        m.setStringProperty("name", "Widget");
        m.setDoubleProperty("price", 0.99);
        m.setJMSExpiration(0); 
        producer.send(m);
        connection.close();
    }
}

====  virtualhosts.xml file which defines testqueue =====

<?xml version="1.0" encoding="ISO-8859-1"?>
<virtualhosts>
    <default>test</default>
    <virtualhost>
        <name>test</name>
        <test>
            <store>
                 <class>org.apache.qpid.server.store.berkeleydb.BDBMessageStore</class>
                 <!-- <class>org.apache.qpid.server.store.MemoryMessageStore</class>
 -->
            </store>

           <housekeeping>
                <threadCount>2</threadCount>
                <expiredMessageCheckPeriod>200000</expiredMessageCheckPeriod>
            </housekeeping>

            <exchanges>
                <exchange>
                    <type>direct</type>
                    <name>test.direct</name>
                    <durable>true</durable>
                </exchange>
                <exchange>
                    <type>topic</type>
                    <name>test.topic</name>
                    <durable>true</durable>
                </exchange>
            </exchanges>

            <queues>
                <minimumAlertRepeatGap>30000</minimumAlertRepeatGap>
                <maximumMessageCount>50</maximumMessageCount>
                <durable>true</durable>
                <queue>
                    <name>testqueue</name>
                    <testqueue>
                        <exchange>amq.direct</exchange>
                        <maximumQueueDepth>4235264</maximumQueueDepth>
    <!-- 4Mb -->
                        <maximumMessageSize>2117632</maximumMessageSize>
  <!-- 2Mb -->
                        <maximumMessageAge>600000</maximumMessageAge>
     <!-- 10 mins -->
                        <durable>true</durable>
                    </testqueue>                    
                </queue>
                <queue>
                    <name>testping</name><durable>true</durable>
                    <testping>
                        <exchange>amq.direct</exchange>
                        <maximumQueueDepth>4235264</maximumQueueDepth>
    <!-- 4Mb -->
                        <maximumMessageSize>2117632</maximumMessageSize>
  <!-- 2Mb -->
                        <maximumMessageAge>600000</maximumMessageAge>
     <!-- 10 mins -->
                        <durable>true</durable>
                    </testping>
                </queue>
            </queues>
        </test>
    </virtualhost>
</virtualhosts>

==== server log file ===============
2011-05-09 11:48:20,544 INFO  [main] (Log4jMessageLogger.java:72) - [Broker] BRK-1001 : Startup
: Version: 0.10 Build: 1091571
2011-05-09 11:48:20,683 WARN  [main] (AMQUserManagementMBean.java:441) - Access rights contains
user 'user' but there is no authentication data for that user
2011-05-09 11:48:20,686 INFO  [main] (Log4jMessageLogger.java:72) - [Broker] MNG-1001 : Startup
2011-05-09 11:48:20,706 INFO  [main] (Log4jMessageLogger.java:72) - [Broker] MNG-1002 : Starting
: RMI Registry : Listening on port 8999
2011-05-09 11:48:20,815 INFO  [main] (Log4jMessageLogger.java:72) - [Broker] MNG-1002 : Starting
: JMX RMIConnectorServer : Listening on port 9099
2011-05-09 11:48:20,816 INFO  [main] (Log4jMessageLogger.java:72) - [Broker] MNG-1004 : Ready
2011-05-09 11:48:20,824 INFO  [main] (Log4jMessageLogger.java:72) - [Broker] VHT-1001 : Created
: test
2011-05-09 11:48:20,866 INFO  [main] (Log4jMessageLogger.java:72) - [Broker] EXH-1001 : Create
: Durable Type: headers Name: amq.match
2011-05-09 11:48:20,872 INFO  [main] (Log4jMessageLogger.java:72) - [Broker] EXH-1001 : Create
: Durable Type: topic Name: amq.topic
2011-05-09 11:48:20,874 INFO  [main] (Log4jMessageLogger.java:72) - [Broker] EXH-1001 : Create
: Durable Type: direct Name: amq.direct
2011-05-09 11:48:20,876 INFO  [main] (Log4jMessageLogger.java:72) - [Broker] EXH-1001 : Create
: Durable Type: fanout Name: amq.fanout
2011-05-09 11:48:20,880 INFO  [main] (Log4jMessageLogger.java:72) - [Broker] EXH-1001 : Create
: Durable Type: direct Name: <<default>>
2011-05-09 11:48:20,884 INFO  [main] (Log4jMessageLogger.java:72) - [Broker] EXH-1001 : Create
: Durable Type: direct Name: test.direct
2011-05-09 11:48:20,886 INFO  [main] (Log4jMessageLogger.java:72) - [Broker] EXH-1001 : Create
: Durable Type: topic Name: test.topic
2011-05-09 11:48:20,912 INFO  [main] (Log4jMessageLogger.java:72) - [Broker] [vh(/test)/qu(testqueue)]
QUE-1001 : Create : Durable
2011-05-09 11:48:20,936 INFO  [main] (Log4jMessageLogger.java:72) - [Broker] [vh(/test)/ex(direct/amq.direct)/qu(testqueue)/rk(testqueue)]
BND-1001 : Create
2011-05-09 11:48:20,938 INFO  [main] (Log4jMessageLogger.java:72) - [Broker] [vh(/test)/qu(testping)]
QUE-1001 : Create : Durable
2011-05-09 11:48:20,946 INFO  [main] (Log4jMessageLogger.java:72) - [Broker] [vh(/test)/ex(direct/amq.direct)/qu(testping)/rk(testping)]
BND-1001 : Create
2011-05-09 11:48:20,963 INFO  [main] (Log4jMessageLogger.java:72) - [Broker] [vh(/test)/ms(BDBMessageStore)]
CFG-1001 : Created : org.apache.qpid.server.store.berkeleydb.BDBMessageStore
2011-05-09 11:48:20,965 INFO  [main] (Log4jMessageLogger.java:72) - [Broker] [vh(/test)/ms(BDBMessageStore)]
MST-1002 : Store location : /home/mahmoud/downloads/qpid-0.10/work/bdbstore/test
2011-05-09 11:48:21,163 INFO  [main] (Log4jMessageLogger.java:72) - [Broker] [vh(/test)/ms(BDBMessageStore)]
MST-1004 : Recovery Start
2011-05-09 11:48:21,168 INFO  [main] (Log4jMessageLogger.java:72) - [Broker] [vh(/test)/ms(BDBMessageStore)]
TXN-1004 : Recovery Start
2011-05-09 11:48:21,187 INFO  [main] (Log4jMessageLogger.java:72) - [Broker] [vh(/test)/ms(BDBMessageStore)]
MST-1001 : Created : org.apache.qpid.server.store.berkeleydb.BDBMessageStore
2011-05-09 11:48:21,230 INFO  [main] (Log4jMessageLogger.java:72) - [Broker] [vh(/test)/ms(BDBMessageStore)]
TXN-1001 : Created : org.apache.qpid.server.store.berkeleydb.BDBMessageStore
2011-05-09 11:48:21,231 WARN  [main] (VirtualHostConfigRecoveryHandler.java:346) - Message
id 1 in store, but not in any queue - removing....
2011-05-09 11:48:21,264 WARN  [main] (VirtualHostConfigRecoveryHandler.java:346) - Message
id 2 in store, but not in any queue - removing....
2011-05-09 11:48:21,268 INFO  [main] (Log4jMessageLogger.java:72) - [Broker] [vh(/test)/ms(BDBMessageStore)]
TXN-1006 : Recovery Complete
2011-05-09 11:48:21,360 INFO  [main] (Log4jMessageLogger.java:72) - [Broker] BRK-1002 : Starting
: Listening on TCP port 5672
2011-05-09 11:48:21,361 INFO  [main] (Log4jMessageLogger.java:72) - [Broker] BRK-1004 : Qpid
Broker Ready
2011-05-09 11:49:25,820 INFO  [MINANetworkDriver(Acceptor)-2] (Log4jMessageLogger.java:72)
- [con:1(/192.168.2.37:54514)] CON-1001 : Open
2011-05-09 11:49:25,821 INFO  [MINANetworkDriver(Acceptor)-2] (Log4jMessageLogger.java:72)
- [con:1(/192.168.2.37:54514)] CON-1001 : Open : Protocol Version : 0-10
2011-05-09 11:49:25,916 INFO  [MINANetworkDriver(Acceptor)-5] (Log4jMessageLogger.java:72)
- [con:1(test@/192.168.2.37:54514/test)] CON-1001 : Open : Client ID : test : Protocol Version
: 0-10
2011-05-09 11:49:26,039 INFO  [MINANetworkDriver(Acceptor)-6] (Log4jMessageLogger.java:72)
- [con:1(test@/192.168.2.37:54514/test)/ch:0] CHN-1001 : Create
2011-05-09 11:49:26,105 INFO  [MINANetworkDriver(Acceptor)-9] (Log4jMessageLogger.java:72)
- [con:1(test@/192.168.2.37:54514/test)/ch:0] [vh(/test)/qu(message_testqueue)] QUE-1001 :
Create : Transient
2011-05-09 11:49:26,115 INFO  [MINANetworkDriver(Acceptor)-9] (Log4jMessageLogger.java:72)
- [con:1(test@/192.168.2.37:54514/test)/ch:0] [vh(/test)/ex(direct/<<default>>)/qu(message_testqueue)/rk(message_testqueue)]
BND-1001 : Create
2011-05-09 11:49:26,192 INFO  [MINANetworkDriver(Acceptor)-11] (Log4jMessageLogger.java:72)
- [con:1(test@/192.168.2.37:54514/test)/ch:0] [sub:0(vh(/test)/qu(message_testqueue)] SUB-1001
: Create : Arguments : Browser
2011-05-09 11:49:26,199 INFO  [MINANetworkDriver(Acceptor)-11] (Log4jMessageLogger.java:72)
- [con:1(test@/192.168.2.37:54514/test)/ch:0] [sub:0(vh(/test)/qu(message_testqueue)] SUB-1002
: Close
2011-05-09 11:49:26,240 INFO  [MINANetworkDriver(Acceptor)-13] (Log4jMessageLogger.java:72)
- [con:1(test@/192.168.2.37:54514/test)/ch:0] [sub:1(vh(/test)/qu(message_testqueue)] SUB-1001
: Create : Arguments : Browser
2011-05-09 11:49:26,375 INFO  [MINANetworkDriver(Acceptor)-5] (Log4jMessageLogger.java:72)
- [con:1(test@/192.168.2.37:54514/test)/ch:0] [sub:1(vh(/test)/qu(message_testqueue)] SUB-1002
: Close
2011-05-09 11:49:26,378 INFO  [MINANetworkDriver(Acceptor)-5] (Log4jMessageLogger.java:72)
- [con:1(test@/192.168.2.37:54514/test)/ch:0] [con:1(test@/192.168.2.37:54514/test)/ch:0]
CHN-1003 : Close
2011-05-09 11:49:26,381 INFO  [MINANetworkDriver(Acceptor)-5] (Log4jMessageLogger.java:72)
- [con:1(test@/192.168.2.37:54514/test)] [con:1(test@/192.168.2.37:54514/test)] CON-1002 :
Close

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message