[ 
https://issues.apache.org/jira/browse/AMQCPP-502?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Timothy Bish resolved AMQCPP-502.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 3.8.0

Fixed on trunk
                
> Can't send to temporary queues created by name
> ----------------------------------------------
>
>                 Key: AMQCPP-502
>                 URL: https://issues.apache.org/jira/browse/AMQCPP-502
>             Project: ActiveMQ C++ Client
>          Issue Type: New Feature
>          Components: CMS Impl
>    Affects Versions: 3.4.0
>         Environment: Windows Vista, Visual Studio 2005
>            Reporter: Thomas Krammer
>            Assignee: Timothy Bish
>            Priority: Minor
>             Fix For: 3.8.0
>
>         Attachments: activemq.patch
>
>
> I have a Java process and a C++ process communicating using ActiveMQ. For 
> some messages the C++ process will produce big results which are sent in 
> chunks in separate ByteMessages (very similar to ActiveMQInput/OutputStream). 
> To receive these chunks the Java process generates a temporary queue and 
> sends the name of the queue (result of getQueueName) to the C++ process. The 
> C++ process then sends the ByteMessages to this temporary queue using this 
> code:
>   std::string targetQueue = // get queue name sent by Java
>   session = connection->createSession(cms::Session::AUTO_ACKNOWLEDGE);
>   queue = session->createQueue(targetQueue);
>   producer = session->createProducer(queue);
>   producer->setDeliveryMode(cms::DeliveryMode::PERSISTENT);
>   while(fillBuffer()) {
>     std::auto_ptr<cms::BytesMessage> 
> blockMessage(session->createBytesMessage());
>     blockMessage->writeBytes(reinterpret_cast<unsigned char *>(buffer), 0, 
> bc);
>     producer->send(blockMessage.get());
>   }
> On the Java side I never receive the messages sent by C++ but I don't get any 
> error from the C++ code either. When I change the Java code to create a 
> regular queue instead of a temporary queue the code works fine.
> I had a look at the Java implementation of ActiveMQSession::createQueue and 
> found that they have a special case handling for temporary queues that is 
> missing from the C++ code. After adding this special case to the C++ 
> implementation the code above works fine.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to