The process is performed as your stack largely already shows overall, with bytes arriving from netty, being given to and decoded by proton-j, determined to be an End frame for a particular session and causing the effect in proton, and the resulting event handling in the client triggering the rest of the process. There isnt isnt a simple 'pretend remote close happened' button you can use, for full effect you'll actually need to remotely close the session as I said.
I didnt mean a Service Bus test server, rather a test-specific substitute AMQP 1.0 server. There are various options for creating lightweight servers, e.g such as Qpid Proton, and to an extent Proton-J though only at a lower level, but if you are wanting to use Java the simplest option is probably over at Vert.x leveraging proton-j as an engine. For example you might find some inspiration from the following example and test. https://github.com/vert-x3/vertx-proton/blob/4.0.2/src/test/java/io/vertx/proton/example/HelloWorldServer.java https://github.com/vert-x3/vertx-proton/blob/4.0.2/src/test/java/io/vertx/proton/ProtonClientTest.java#L859 Do note each connection is single threaded and can only used from its callbacks and/or on its vertx context (e.g timers created while in the callback / on the context). See also https://github.com/vert-x3/vertx-proton/blob/3.5/src/main/asciidoc/java/index.adoc#threading-considerations. On Wed, 10 Feb 2021 at 19:41, akabhishek1 <[email protected]> wrote: > > Hey Robbie, > > Thank you so much update. As always, your input helps alot to fix/understand > issue. > > We don't have ServiceBus test server and Microsoft also can't help us to > close session remotely. > > So, we have only one option reproduce this issue - forcefully break > existing JMS session either in debug or test mode. > > I am able to genearate slightly same error with setting below value in Debug > mode while creating JMS Destination > 1. closed.set(true) > 2. failureCause.set(new ProviderException("Unknown error from remote > peer")) > > protected void checkClosed() throws IllegalStateException { > if (closed.get()) { > IllegalStateException jmsEx = null; > if (failureCause.get() == null) { > jmsEx = new > IllegalStateException("The Session is closed"); > } else { > jmsEx = new > IllegalStateException("The Session was closed due to an > unrecoverable error."); > jmsEx.initCause(failureCause.get()); > } > throw jmsEx; > } > } > > > In actual scenario, JmsSession.setFailureCause() and > JmsSession.closed.set(true) getting called from proton/Netty library. Refer > - Netty_Call_Hierarchy.PNG > <http://qpid.2158936.n2.nabble.com/file/t396358/Netty_Call_Hierarchy.PNG> > > We want to generate same error forcefully with Qpid-Proton library. I > checked the call hierarchy of JmsSession.setFailureCause() which is getting > set by AmqpAbstractResource.processRemoteClose method - refer > SetFailureCause_Hierarchy.PNG > <http://qpid.2158936.n2.nabble.com/file/t396358/SetFailureCause_Hierarchy.PNG> > > Can you please guide us source location of Netty/proton class which > derives/triggers to close JMS session and .setFailureCause(). > > It will really help us to forcefully generate actual error. Please let me > know for any input. > > Thanks again for help!! > > Regards, > Abhishek Kumar > > > > -- > Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
