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

ASF GitHub Bot commented on ARTEMIS-1486:
-----------------------------------------

Github user mtaylor commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1629#discussion_r148502940
  
    --- Diff: 
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
 ---
    @@ -1978,6 +1980,36 @@ public void testConnectorServiceManagement() throws 
Exception {
           Assert.assertEquals("myconn2", 
managementControl.getConnectorServices()[0]);
        }
     
    +   @Test
    +   public void testCloseConsumer() throws Exception {
    +      SimpleString address = RandomUtil.randomSimpleString();
    +      SimpleString name = RandomUtil.randomSimpleString();
    +      boolean durable = true;
    +
    +      ActiveMQServerControl serverControl = createManagementControl();
    +
    +      
checkNoResource(ObjectNameBuilder.DEFAULT.getQueueObjectName(address, name, 
RoutingType.ANYCAST));
    +      serverControl.createAddress(address.toString(), "ANYCAST");
    +      serverControl.createQueue(address.toString(), "ANYCAST", 
name.toString(), null, durable, -1, false, false);
    +
    +      ServerLocator receiveLocator = createInVMNonHALocator();
    +      ClientSessionFactory receiveCsf = 
createSessionFactory(receiveLocator);
    +      ClientSession receiveClientSession = receiveCsf.createSession(true, 
false, false);
    +      final ClientConsumer consumer = 
receiveClientSession.createConsumer(name);
    +      final ClientProducer producer = 
receiveClientSession.createProducer(name);
    +
    +      ServerSession ss = server.getSessions().iterator().next();
    +      ServerConsumer sc = ss.getServerConsumers().iterator().next();
    +
    +      producer.send(receiveClientSession.createMessage(true));
    +      consumer.receive(1000);
    +
    +      Assert.assertFalse(consumer.isClosed());
    +      
serverControl.closeConsumerWithID(((ClientSessionImpl)receiveClientSession).getName(),
 Long.toString(sc.sequentialID()));
    +      Wait.waitFor(() -> consumer.isClosed(), 1000, 100);
    +      Assert.assertTrue(consumer.isClosed());
    +   }
    +
        protected void scaleDown(ScaleDownHandler handler) throws Exception {
    --- End diff --
    
    Nice test.  I realise this is outside the scope of this JIRA, but some more 
testing around other protocols would be useful, in addition it'd be good to 
test that this works with the Artemis JMS Client since it uses CORE under the 
covers.  We can do these in follow up commits.
    
    +1 overall.  Merging


> Core client should be notified if consumer is closed on broker side
> -------------------------------------------------------------------
>
>                 Key: ARTEMIS-1486
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-1486
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>            Reporter: Stanislav Knot
>            Priority: Major
>
> If consumer is closed on broker using e.g. Hawtio console, client connected 
> as that consumer (representation of broker resource) should be notified about 
> that fact and react to that. It doesn't seem to react. If consumer is closed, 
> as a result of not being notified, client hangs in the air and cannot receive 
> messages.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to