[
https://issues.apache.org/jira/browse/ARTEMIS-5437?focusedWorklogId=967332&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-967332
]
ASF GitHub Bot logged work on ARTEMIS-5437:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 23/Apr/25 19:21
Start Date: 23/Apr/25 19:21
Worklog Time Spent: 10m
Work Description: clebertsuconic commented on code in PR #5647:
URL: https://github.com/apache/activemq-artemis/pull/5647#discussion_r2056746789
##########
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPBridgeToAddressTest.java:
##########
@@ -178,35 +179,30 @@ public void
testBridgeCreatesAddressSenderWhenLocalAddressIsStaticlyDefined() th
// should be the thing that triggers the bridging. The connection
should remain active and
// respond if the address is recreated later.
logger.info("Removing Address from bridged address to eliminate
sender");
- server.removeAddressInfo(SimpleString.of(getTestName()), null, true);
-
- peer.waitForScriptToComplete(5, TimeUnit.SECONDS);
+ server.removeAddressInfo(SimpleString.of(getTestName() + ".1"), null,
true);
Wait.assertFalse(() ->
server.addressQuery(SimpleString.of(getTestName())).isExists());
+ peer.waitForScriptToComplete(5, TimeUnit.SECONDS);
+
+ peer.waitForScriptToComplete(5, TimeUnit.SECONDS);
peer.expectAttach().ofSender()
- .withTarget().withAddress(getTestName()).also()
- .withSource().withAddress(getTestName()).also()
- .withName(allOf(containsString(getTestName()),
+ .withTarget().withAddress(getTestName() +
".2").also()
+ .withSource().withAddress(getTestName() +
".2").also()
+ .withName(allOf(containsString(getTestName() +
".2"),
containsString("address-sender"),
containsString("amqp-bridge"),
containsString(server.getNodeID().toString())))
.respond();
peer.remoteFlow().withLinkCredit(1).queue();
- final ConnectionFactory factory =
CFUtil.createConnectionFactory("AMQP", "tcp://localhost:" + AMQP_PORT);
-
- // Producer connect should create the address and initiate the bridge
sender attach
- try (Connection connection = factory.createConnection()) {
- final Session session =
connection.createSession(Session.AUTO_ACKNOWLEDGE);
- session.createProducer(session.createTopic(getTestName()));
-
- Wait.assertTrue(() ->
server.addressQuery(SimpleString.of(getTestName())).isExists());
- Wait.assertTrue(() ->
server.bindingQuery(SimpleString.of(getTestName())).getQueueNames().size() > 0);
+ // Add another address that matches the filter and the bridge should
form without a reconnect.
+ server.addAddressInfo(new AddressInfo(SimpleString.of(getTestName() +
".2"), RoutingType.MULTICAST));
- peer.waitForScriptToComplete(5, TimeUnit.SECONDS);
- }
+ Wait.assertTrue(() ->
server.addressQuery(SimpleString.of(getTestName() + ".2")).isExists());
Review Comment:
One thng I have been doing when I add new Wait.assert... is to use my own
timeouts.. (I suggest something like , 5000, 100)
I think we should remove the default method... 30 second as a default is a
long time
Issue Time Tracking
-------------------
Worklog Id: (was: 967332)
Time Spent: 1h 10m (was: 1h)
> Add a more advanced message bridging feature to AMQP broker connections
> -----------------------------------------------------------------------
>
> Key: ARTEMIS-5437
> URL: https://issues.apache.org/jira/browse/ARTEMIS-5437
> Project: ActiveMQ Artemis
> Issue Type: New Feature
> Components: AMQP
> Affects Versions: 2.40.0
> Reporter: Timothy A. Bish
> Assignee: Timothy A. Bish
> Priority: Major
> Labels: pull-request-available
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> The AMQP broker connection currently offers a somewhat primitive bridge
> capability by offering configuration of SENDER and RECEIVER elements which
> can perform some basic bridging primarily between Artemis instances given the
> way the send to address, receiver from queue behavior is carried over into
> the implementation.
> This new AMQP bridge feature offers a more advanced and flexible bridge
> capability that allows for messages to be bridged from or to a remote with
> various configuration options to account for the remote not being an Artemis
> peer but leveraging some Artemis capabilities like Core message tunneling
> over AMQP when the remote is an Artemis instance. By default the receivers
> for this bridge implementation activate only on local demand being present
> but can be configured to be always active as the older RECEIVER capability
> currently behaves.
> This implementation also incorporates features implemented in the AMQP
> federation bits that deal with draining link credit on receivers before
> detaching to avoid potential duplicates and idling links if demand tracking
> is active (default mode) to avoid rapid create and destroy cycles for bridge
> receiver links. There is also in-built link recovery mechanisms that will
> attempt to recreate links that are closed by the remote on a periodic basis.
> Also like federation Queue receivers the new bridge receivers can be
> configured in pull mode to only offer credit when the local Queue has no
> pending backlog to avoid moving messages until there is a need.
> A example of configuration for an AMQP broker connection bridge is shown below
> {code:xml}
> <amqp-connection uri="tcp://host:port"
> name="my-bridge-configuration">
> <bridge>
> <bridge-from-queue name="policy-name-1">
> <include address-match="#" queue-match="someQueue" />
> <property key="amqpCredits" value="0"/>
> <property key="amqpPullConsumerCredits" value="10"/>
> </bridge-from-queue>
> <bridge-to-queue name="policy-name-2">
> <include address-match="test" queue-match="myQueue" />
> </bridge-to-queue>
> <bridge-from-address name="policy-name-3">
> <include address-match="test-address" />
> <exclude address-match="all.#" />
> </bridge-from-address>
> <bridge-to-address name="policy-name-4">
> <include address-match="send-to-address" />
> <exclude address-match="all.#" />
> </bridge-to-address>
> </bridge>
> </amqp-connection>
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact