File tree Expand file tree Collapse file tree 1 file changed +25
-3
lines changed
test/src/com/rabbitmq/client/test Expand file tree Collapse file tree 1 file changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -18,15 +18,37 @@ public boolean hadValidShutdown(){
1818 }
1919
2020 public SpecialConnection () throws Exception {
21- super (new ConnectionParameters (), new SocketFrameHandler (SocketFactory .getDefault ().createSocket ("localhost" , 5672 )));
22- this .start (true );
23- }
21+ super (
22+ new ConnectionParameters (),
23+ new SocketFrameHandler (SocketFactory .getDefault ().createSocket ("localhost" , 5672 )),
24+ new DefaultExceptionHandler (){
25+ @ Override public void handleConsumerException (Channel channel ,
26+ Throwable exception ,
27+ Consumer consumer ,
28+ String consumerTag ,
29+ String methodName ){
30+ try {
31+ ((AMQConnection ) channel .getConnection ()).close (AMQP .INTERNAL_ERROR ,
32+ "Internal error in Consumer " +
33+ consumerTag ,
34+ false ,
35+ exception );
36+ } catch (IOException ioe ) {
37+ // Man, this clearly isn't our day.
38+ // Ignore the exception? TODO: Log the nested failure
39+ }
40+ }
41+ });
42+
43+ this .start (true );
44+ }
2445
2546 @ Override
2647 public boolean processControlCommand (Command c ) throws IOException {
2748 if (c .getMethod () instanceof AMQP .Connection .CloseOk ) validShutdown .set (true );
2849 return super .processControlCommand (c );
2950 }
51+
3052 }
3153
3254
You can’t perform that action at this time.
0 commit comments