[ 
https://issues.apache.org/jira/browse/PROTON-1917?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16593281#comment-16593281
 ] 

Jeremy commented on PROTON-1917:
--------------------------------

My bad. As I said, I was testing from a different host 'lahad01', to ensure a 
fresh broker environment. That being said, I also tested from my own machine 
(same as before), and I will be posting the logs.

As you can see from the logs above, the consumer consumed a couple of messages, 
then, upon broker restart, I got an amqp not-found error unknown hostname...

The logs on my machine are the following:
{code:java}
main: start
receive_with_retry on_container_start
receive_with_retry on_connection_open
receive_with_retry on_session_open
receive_with_retry on_receiver_open
[00000000002E5C70]:(PN_PROACTOR_TIMEOUT)
[00000000002E5C70]:(PN_PROACTOR_TIMEOUT)
[00000000002E5C70]:(PN_PROACTOR_TIMEOUT)
receive_with_retry on_connection_open
receive_with_retry on_session_open
receive_with_retry on_receiver_open
receive_with_retry on_receiver_open
[00000000002E5C70]:(PN_PROACTOR_TIMEOUT)
[00000000002E5C70]:(PN_PROACTOR_TIMEOUT)
receive_with_retry on_connection_open
receive_with_retry: on_error: amqp:not-found: Virtual host 'localhost' is not 
active
[00000000002E5C70]:(PN_PROACTOR_INACTIVE)
[00000000002E5C70]:(PN_PROACTOR_INTERRUPT)
main: end
Press any key to continue . . .{code}
Same error on my machine. Not that I cleaned the qpid broker cache under 
C:\Users\jeremy\appdata\... I generated a new work dir for the patched broker, 
and copied the config from the old broker.

Not sure if the patched broker logs will help. I kill the broker with a ctrl-c 
then start it on the same port. For my last scenario, the queue does not 
contain any messages.
{code:java}
D:\qpid\qpid-broker\7.0.3-patched>bin\qpid-server.bat -prop 
"BROKER_HTTP_PORT=10102" -prop "BROKER_AMQP_PORT=5673"
Warning: Qpid classpath not set. CLASSPATH set to 
D:\qpid\qpid-broker\7.0.3-patched\lib\*;D:\qpid\qpid-broker\7.0.3-patched\lib\plugins\*;D:\qpid\qpid-broker\7.
0.3-patched\lib\opt\*
Info: QPID_JAVA_GC not set. Defaulting to JAVA_GC -XX:+UseConcMarkSweepGC 
-XX:+HeapDumpOnOutOfMemoryError
Info: QPID_JAVA_MEM not set. Defaulting to JAVA_MEM -Xmx512m 
-XX:MaxDirectMemorySize=1536m
[Broker] BRK-1006 : Using configuration : 
D:\qpid\qpid-broker\7.0.3-patched\jeremy\config.json
[Broker] BRK-1001 : Startup : Version: 7.0.3 Build: 
62d7ae692b47746c42949c2e646f33a966e6a1a1
[Broker] BRK-1010 : Platform : JVM : Oracle Corporation version: 1.8.0_131-b11 
OS : Windows 7 version: 6.1 arch: amd64 cores: 12
[Broker] BRK-1011 : Maximum Memory : Heap : 518,979,584 bytes Direct : 
1,610,612,736 bytes
[Broker] BRK-1017 : Process : PID : 21400
[Broker] BRK-1002 : Starting : Listening on TCP port 5673
[Broker] MNG-1001 : Web Management Startup
[Broker] MNG-1002 : Starting : HTTP : Listening on TCP port 10102
[Broker] MNG-1004 : Web Management Ready
[Broker] BRK-1019 : WARNING - some services were unable to start. The following 
components are in the ERRORed state [BrokerLogger[id=83452a76-8bc4-43ca-97fc-15c
4c417c546, name=logfile, type=File]]
[Broker] BRK-1004 : Qpid Broker Ready
Terminate batch job (Y/N)?
^CThe system cannot open the device or file specified.
D:\qpid\qpid-broker\7.0.3-patched>
D:\qpid\qpid-broker\7.0.3-patched>bin\qpid-server.bat -prop 
"BROKER_HTTP_PORT=10102" -prop "BROKER_AMQP_PORT=5673"
Warning: Qpid classpath not set. CLASSPATH set to 
D:\qpid\qpid-broker\7.0.3-patched\lib\*;D:\qpid\qpid-broker\7.0.3-patched\lib\plugins\*;D:\qpid\qpid-broker\7.
0.3-patched\lib\opt\*
Info: QPID_JAVA_GC not set. Defaulting to JAVA_GC -XX:+UseConcMarkSweepGC 
-XX:+HeapDumpOnOutOfMemoryError
Info: QPID_JAVA_MEM not set. Defaulting to JAVA_MEM -Xmx512m 
-XX:MaxDirectMemorySize=1536m
[Broker] BRK-1006 : Using configuration : 
D:\qpid\qpid-broker\7.0.3-patched\jeremy\config.json
[Broker] BRK-1001 : Startup : Version: 7.0.3 Build: 
62d7ae692b47746c42949c2e646f33a966e6a1a1
[Broker] BRK-1010 : Platform : JVM : Oracle Corporation version: 1.8.0_131-b11 
OS : Windows 7 version: 6.1 arch: amd64 cores: 12
[Broker] BRK-1011 : Maximum Memory : Heap : 518,979,584 bytes Direct : 
1,610,612,736 bytes
[Broker] BRK-1017 : Process : PID : 15788
[Broker] BRK-1002 : Starting : Listening on TCP port 5673
[Broker] MNG-1001 : Web Management Startup
[Broker] MNG-1002 : Starting : HTTP : Listening on TCP port 10102
[Broker] MNG-1004 : Web Management Ready
[Broker] BRK-1019 : WARNING - some services were unable to start. The following 
components are in the ERRORed state [BrokerLogger[id=11602439-fc97-4a3c-ae73-51d
18dde6ffb, name=logfile, type=File]]
[Broker] BRK-1004 : Qpid Broker Ready
Terminate batch job (Y/N)?
^C
D:\qpid\qpid-broker\7.0.3-patched>

D:\qpid\qpid-broker\7.0.3-patched>bin\qpid-server.bat -prop 
"BROKER_HTTP_PORT=10102" -prop "BROKER_AMQP_PORT=5673"
Warning: Qpid classpath not set. CLASSPATH set to 
D:\qpid\qpid-broker\7.0.3-patched\lib\*;D:\qpid\qpid-broker\7.0.3-patched\lib\plugins\*;D:\qpid\qpid-broker\7.
0.3-patched\lib\opt\*
Info: QPID_JAVA_GC not set. Defaulting to JAVA_GC -XX:+UseConcMarkSweepGC 
-XX:+HeapDumpOnOutOfMemoryError
Info: QPID_JAVA_MEM not set. Defaulting to JAVA_MEM -Xmx512m 
-XX:MaxDirectMemorySize=1536m
[Broker] BRK-1006 : Using configuration : 
D:\qpid\qpid-broker\7.0.3-patched\jeremy\config.json
[Broker] BRK-1001 : Startup : Version: 7.0.3 Build: 
62d7ae692b47746c42949c2e646f33a966e6a1a1
[Broker] BRK-1010 : Platform : JVM : Oracle Corporation version: 1.8.0_131-b11 
OS : Windows 7 version: 6.1 arch: amd64 cores: 12
[Broker] BRK-1011 : Maximum Memory : Heap : 518,979,584 bytes Direct : 
1,610,612,736 bytes
[Broker] BRK-1017 : Process : PID : 21408
[Broker] BRK-1002 : Starting : Listening on TCP port 5673
[Broker] MNG-1001 : Web Management Startup
[Broker] MNG-1002 : Starting : HTTP : Listening on TCP port 10102
[Broker] MNG-1004 : Web Management Ready
[con:0(/0:0:0:0:0:0:0:1:44267)] CON-1001 : Open : Destination : 
AMQP(0:0:0:0:0:0:0:1:5673) : Protocol Version : 1.0
[con:0(ANONYMOUS@/0:0:0:0:0:0:0:1:44267)] CON-1004 : Connection dropped
[Broker] BRK-1019 : WARNING - some services were unable to start. The following 
components are in the ERRORed state [BrokerLogger[id=2fd6bec4-5f12-4ad7-bd8b-ed5
26e7abb50, name=logfile, type=File]]
[Broker] BRK-1004 : Qpid Broker Ready
Terminate batch job (Y/N)?
^C
D:\qpid\qpid-broker\7.0.3-patched>{code}

> [proton-c] the c++ proton consumer with retry should continue to retry if 
> virtual host not active
> -------------------------------------------------------------------------------------------------
>
>                 Key: PROTON-1917
>                 URL: https://issues.apache.org/jira/browse/PROTON-1917
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: cpp-binding
>    Affects Versions: proton-c-0.22.0
>            Reporter: Jeremy
>            Priority: Major
>
> I have a running broker, and a configured queue containing messages.
> I also have a consumer, where I configured the max number of attempts to 0 
> (infinite retry).
> I kill the broker (ctrl-c) and start it on the same port.
>  Upon reconnection, I get the following error message randomly:
> {code:java}
> receive_with_retry on_connection_open
> receive_with_retry: on_error: amqp:not-found: Virtual host 'localhost' is not 
> active
> main: end{code}
> In the case where the consumer is able to connect, the consumer continues to 
> consume the messages normally.
> However, in the broker web interface, I see upon each re-connection, an extra 
> connection (same ip and port) to the queue. As if, the old connection is not 
> killed. I wasn't expecting this behavior. This might be a separate issue.
> I was able to reproduce with the following code, on windows 7 (msvc 12 2013)
> {code:java}
> class receive_with_retry : public proton::messaging_handler {
> private:
>    std::string url;
>    std::string queueName;
> public:
>    receive_with_retry(const std::string &u, const std::string& q) : url(u), 
> queueName(q) {}
>    void on_container_start(proton::container &c) override {
>       std::cout << "receive_with_retry on_container_start" << std::endl;
>       c.connect(
>          url,
>          proton::connection_options()
>             .idle_timeout(proton::duration(2000))
>             .reconnect(proton::reconnect_options()
>                         .max_attempts(0)
>                         .delay(proton::duration(3000))
>                         .delay_multiplier(1)
>                         .max_delay(proton::duration(3001))));
>    }
>    void on_connection_open(proton::connection& c) override {
>       std::cout << "receive_with_retry on_connection_open " << std::endl;
>       c.open_receiver(queueName, 
> proton::receiver_options().auto_accept(false));
>    }
>    void on_session_open(proton::session& session) override {
>       std::cout << "receive_with_retry on_session_open " << std::endl;
>    }
>    void on_receiver_open(proton::receiver& receiver) override {
>       std::cout << "receive_with_retry on_receiver_open " << std::endl;
>       receiver.open();
>    }
>    void on_message(proton::delivery& delivery, proton::message &message) 
> override {
>       std::cout << "receive_with_retry on_message " << message.body() << 
> std::endl;
>       // Can be used for throttling
>       // std::this_thread::sleep_for(std::chrono::milliseconds(100));
>       // commented out in order not to exit immediately, but continue on 
> consuming the messages.
>       // delivery.receiver().close();
>       // delivery.receiver().connection().close();
>    }
>    void on_transport_error(proton::transport& error) override {
>       std::cout << "receive_with_retry: on_transport_error: " << 
> error.error().what() << std::endl;
>       error.connection().close();
>    }
>    void on_error(const proton::error_condition& error) override {
>       std::cout << "receive_with_retry: on_error: " << error.what() << 
> std::endl;
>    }
> };
> void receiveWithRetry(const std::string& url, const std::string& queueName){
>    try {
>       std::cout << "main: start" << std::endl;
>       receive_with_retry receiveWithRetry(url, queueName);
>       proton::container(receiveWithRetry).run();
>       std::cout << "main: end" << std::endl;
>    }
>    catch (const std::exception& cause) {
>       std::cout << "main: caught exception: " << cause.what() << std::endl;
>    }
> }
> int main() {
>    try {
>       receiveWithRetry("amqp://localhost:5673", "test_queue");
>       return 0;
>    }
>    catch (const std::exception& e) {
>       std::cerr << e.what() << std::endl;
>    }
>    return 1;
> }
> {code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to