[ 
https://issues.apache.org/jira/browse/ARTEMIS-3759?focusedWorklogId=763577&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-763577
 ]

ASF GitHub Bot logged work on ARTEMIS-3759:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 28/Apr/22 15:08
            Start Date: 28/Apr/22 15:08
    Worklog Time Spent: 10m 
      Work Description: iliya-gr commented on code in PR #4054:
URL: https://github.com/apache/activemq-artemis/pull/4054#discussion_r861007512


##########
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPReplicaTest.java:
##########
@@ -473,6 +473,73 @@ public void testNoAddressWithAnnotations() throws 
Exception {
       }
    }
 
+   @Test
+   public void testAddressFilter() throws Exception {
+      server.start();
+
+      server_2 = createServer(AMQP_PORT_2, false);
+      server_2.setIdentity("server_2");
+      server_2.getConfiguration().setName("server_2");
+
+      AMQPBrokerConnectConfiguration amqpConnection = new 
AMQPBrokerConnectConfiguration("mirror-source", "tcp://localhost:" + 
AMQP_PORT).setReconnectAttempts(-1).setRetryInterval(100);
+      AMQPMirrorBrokerConnectionElement replica = new 
AMQPMirrorBrokerConnectionElement().setDurable(true).setAddressFilter("replicated,!nonReplicated");
+      amqpConnection.addElement(replica);
+      server_2.getConfiguration().addAMQPConnection(amqpConnection);
+
+      server_2.start();
+
+      {
+         // Send to nonReplicated address
+         ConnectionFactory factory = CFUtil.createConnectionFactory("AMQP", 
"tcp://localhost:" + AMQP_PORT_2);
+         Connection connection = factory.createConnection();
+         Session session = connection.createSession(false, 
Session.AUTO_ACKNOWLEDGE);
+         MessageProducer producer = 
session.createProducer(session.createQueue("nonReplicated"));
+         producer.setDeliveryMode(DeliveryMode.PERSISTENT);
+         producer.send(session.createTextMessage("never receive"));
+         connection.close();
+      }

Review Comment:
   Everything is in try-with-resources block now.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 763577)
    Time Spent: 2h  (was: 1h 50m)

> Allow for Mirroring (Broker Connections) to specify a specific set of 
> addresses to send events, as is done for a cluster connection  
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: ARTEMIS-3759
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-3759
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>          Components: AMQP
>    Affects Versions: 2.19.1, 2.21.0
>            Reporter: Mikhail Lukyanov
>            Priority: Major
>         Attachments: ImageAddressSyntax.png, ImageInternalQueues.png
>
>          Time Spent: 2h
>  Remaining Estimate: 0h
>
> If a target broker of mirroring is in a cluster, then mirroring of the 
> broker's internal queues also occurs, and often messages accumulate in such 
> queues. In theory, internal cluster queues should not be mirrored, this does 
> not make much sense. 
> Therefore, it would be convenient to allow you to configure for which 
> addresses and their queues mirroring will be performed, events will be sent 
> (message-acknowledgements, queue-removal, queue-creation). The syntax that is 
> used to specify the *_addresses_* of the *_cluster connection_* is well 
> suited for this. 
> Mirrored internal cluster queues
>  !ImageInternalQueues.png! 
> Address syntax
>  !ImageAddressSyntax.png! 



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to