Dominic,

I posted my code for the community.
But I progress, and all works, but I saw, with this code, the memory grow up in 
each time, I did this function:

pn_link_t* link;
pn_messenger_subscribe(msgConsumer, "amqp://127.0.0.1:5672/queue://myqueue");
link = pn_messenger_get_link(msgConsumer, 
("amqp://127.0.0.1:5672/queue://myqueue").c_str(), false);
pn_link_open(link);

pn_terminus_t* terminus = pn_link_source(link);
pn_data_t* data = pn_terminus_filter (terminus);
/* Map creation with selector*/
std::string selector = "jms-selector";
pn_data_put_map(data);
pn_data_enter(data);;
pn_data_put_symbol(data, pn_bytes(selector.size(), selector.c_str()));
// Described of the JMS_SELECTOR line 1262
std::string filter = "JMSCorrelationID='12346789'";
pn_data_put_described(data);
pn_data_enter(data);
pn_data_put_string(data, pn_bytes(6, "string"));
pn_data_put_string(data, pn_bytes(filter.size(), filter.c_str()));
pn_data_exit(data);

pn_messenger_recv(msgConsumer, -1);
if (pn_messenger_incoming(msgConsumer))
{
      // The message is arrived
      pn_message_t* message = pn_message();
      pn_messenger_get(msgConsumer, message);
      .....
      .....
      pn_message_free(message);
}
pn_link_close(link);


The goal is simple, why I implemented this, because I implemented the pattern 
request/reply, and the reply is in function of the correlationid (setted in the 
 request), so in my application I have the msgConsumer builds one time, and I 
reuse it each time, that I wait the reply.
Perhaps I must free some object, but in debug mode and checking the memory, 
memory grow up, each time I do pn_messenger_subscribe, pn_messenger_recv, etc.


Cheers

From: Dominic Evans [via Qpid] 
[mailto:ml-node+s2158936n7617327...@n2.nabble.com]
Sent: mercredi 10 décembre 2014 12:07
To: Millieret, Xavier
Subject: Re: CorrelationId

Hi Xavier, so 006FE360 is your messenger that is responsible for subscribing 
and receiving the messages based upon the selector.
xavier wrote
[006FE360]:  -> SASL
[006FE360]:0 -> @sasl-init(65) [mechanism=:PLAIN, 
initial-response=b"\x00emc2\x00emc2"]
[006FE360]:  <- SASL
[006FE360]:0 <- @sasl-mechanisms(64) 
[sasl-server-mechanisms=@PN_SYMBOL[:ANONYMOUS, :PLAIN]]
[006FE360]:0 <- @sasl-outcome(68) [code=0]
[006FE360]:  -> AMQP
[006FE360]:0 -> @open(16) [container-id="6aae955e-cd32-488a-8119-67ec0b715924", 
hostname="localhost"]
[006FE360]:0 -> @begin(17) [next-outgoing-id=0, incoming-window=2147483647, 
outgoing-window=0]
[006FE360]:0 -> @attach(18) [name="queue://emc2-ea2a65", handle=0, role=true, 
snd-settle-mode=1, rcv-settle-mode=0, source=@source(40) [address="queue
://emc2-ea2a65", durable=0, timeout=0, dynamic=false, 
filter={:"jms-selector"=@"string" 
"JMSCorrelationID='28a8d7e8-bb82-e41e-1236-5c9f77a057c7'"}], t
arget=@target(41) [address="queue://emc2-ea2a65", durable=0, timeout=0, 
dynamic=false], initial-delivery-count=0]
[006FE360]:0 -> @flow(19) [incoming-window=2147483647, next-outgoing-id=0, 
outgoing-window=0, handle=0, delivery-count=0, link-credit=1024, drain=fals
e]
[006FE360]:  <- AMQP
[006FE360]:0 <- @open(16) [container-id="", hostname="", 
max-frame-size=4294967295, channel-max=32767, 
properties={:"x-opt-anonymous-relay"="$relay"}]

[006FE360]:0 <- @begin(17) [remote-channel=0, next-outgoing-id=1, 
incoming-window=0, outgoing-window=0, handle-max=1024]
[006FE360]:0 <- @flow(19) [next-incoming-id=0, incoming-window=2147483647, 
next-outgoing-id=1, outgoing-window=0]
[006FE360]:0 <- @attach(18) [name="queue://emc2-ea2a65", handle=0, role=false, 
snd-settle-mode=2, rcv-settle-mode=0, source=@source(40) [address="queu
e://emc2-ea2a65", durable=0, expiry-policy=:"session-end", timeout=0, 
dynamic=false, filter={:"jms-selector"=@"string" "JMSCorrelationID='28a8d7e8-bb8
2-e41e-1236-5c9f77a057c7'"}], target=@target(41) 
[address="queue://emc2-ea2a65"], incomplete-unsettled=false, 
initial-delivery-count=0]
[006FE360]:0 <- @transfer(20) [handle=0, delivery-id=0, delivery-tag=b"", 
message-format=0, settled=true] (407) "\x00Sp\xc0\x04\x02BP\x04\x00Sr\xc1\x1
7\x02\xa3\x0dx-opt-to-type\xa1\x05queue\x00Ss\xc0\x7f\x0a\xa12ID:GREFRWHP1006921-61781-1418144200447-1:1:383:1:1@\xa1\x13queue://emc2-ea2a65@@\xa1$28a
8d7e8-bb82-e41e-1236-5c9f77a057c7@@@\x83\x00\x00\x01J3\xc9\xc9\x12\x00Sw\xa1\xe9{"header":{"manufacturer":"com.eaton.pqsoft","uuid":"c1b3e315-a5e4-47b
4-8128-51b0bf6284b7","timeStamp":1418208069,"providerId":"emc4j","flowType":"reply","destination":"TestSimpleBus.add","contentType":"java.lang.Integer
"},"body":18}"
We can see it connect, make the @attach, receive an ACK to that @attach, and 
then receive its first message via the @transfer. However, after that we no 
longer see that messenger doing anything? Based upon the earlier discussions, 
I'd have expected to see an @close for the pn_link_{close,detach} and then a 
fresh @attach for a link with the new correlation id selector.
________________________________
If you reply to this email, your message will be added to the discussion below:
http://qpid.2158936.n2.nabble.com/CorrelationId-tp7614606p7617327.html
To unsubscribe from CorrelationId, click 
here<http://qpid.2158936.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=7614606&code=eGF2aWVybWlsbGllcmV0QGVhdG9uLmNvbXw3NjE0NjA2fDIzNDEwNTMzMA==>.
NAML<http://qpid.2158936.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>



________________________________
Eaton Industries (France) S.A.S ~ Siège social: 110 Rue Blaise Pascal, Immeuble 
Le Viséo - Bâtiment A Innovallée, 38330, Montbonnot-St.-Martin, France ~ Lieu 
d'enregistrement au registre du commerce: Grenoble ~ Numéro d'enregistrement: 
509 653 176 ~ Capital social souscrit et liberé:EUR 16215441 ~ Numéro de TVA: 
FR47509653176

________________________________






--
View this message in context: 
http://qpid.2158936.n2.nabble.com/CorrelationId-tp7614606p7617349.html
Sent from the Apache Qpid Proton mailing list archive at Nabble.com.

Reply via email to