[
https://issues.apache.org/jira/browse/ARTEMIS-3074?focusedWorklogId=539428&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-539428
]
ASF GitHub Bot logged work on ARTEMIS-3074:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 22/Jan/21 01:57
Start Date: 22/Jan/21 01:57
Worklog Time Spent: 10m
Work Description: jbertram commented on a change in pull request #3412:
URL: https://github.com/apache/activemq-artemis/pull/3412#discussion_r562318157
##########
File path:
artemis-server/src/main/java/org/apache/activemq/artemis/core/config/BridgeConfiguration.java
##########
@@ -360,6 +498,98 @@ public BridgeConfiguration setCallTimeout(long
callTimeout) {
return this;
}
+ /**
+ * This method returns a JSON-formatted {@code String} representation of
this {@code QueueConfiguration}. It is a
+ * simple collection of key/value pairs. The keys used are referenced in
{@link #set(String, String)}.
+ *
+ * @return a JSON-formatted {@code String} representation of this {@code
QueueConfiguration}
Review comment:
The JavaDoc references `QueueConfiguration`.
##########
File path:
artemis-server/src/main/java/org/apache/activemq/artemis/core/config/BridgeConfiguration.java
##########
@@ -360,6 +498,98 @@ public BridgeConfiguration setCallTimeout(long
callTimeout) {
return this;
}
+ /**
+ * This method returns a JSON-formatted {@code String} representation of
this {@code QueueConfiguration}. It is a
+ * simple collection of key/value pairs. The keys used are referenced in
{@link #set(String, String)}.
+ *
+ * @return a JSON-formatted {@code String} representation of this {@code
QueueConfiguration}
+ */
+ public String toJSON() {
+ JsonObjectBuilder builder = JsonLoader.createObjectBuilder();
+
+ if (getName() != null) {
+ builder.add(NAME, getName());
+ }
+ if (getQueueName() != null) {
+ builder.add(QUEUE_NAME, getQueueName());
+ }
+ if (getForwardingAddress() != null) {
+ builder.add(FORWARDING_ADDRESS, getForwardingAddress());
+ }
+ if (getFilterString() != null) {
+ builder.add(FILTER_STRING, getFilterString());
+ }
+ if (getStaticConnectors() != null) {
+ JsonArrayBuilder arrayBuilder = JsonLoader.createArrayBuilder();
+ getStaticConnectors().forEach(arrayBuilder::add);
+ builder.add(STATIC_CONNECTORS, arrayBuilder);
+ }
+ if (getDiscoveryGroupName() != null) {
+ builder.add(DISCOVERY_GROUP_NAME, getDiscoveryGroupName());
+ }
+ builder.add(HA, isHA());
+ if (getTransformerConfiguration() != null) {
+ TransformerConfiguration tc = getTransformerConfiguration();
+ JsonObjectBuilder tcBuilder = JsonLoader.createObjectBuilder()
+ .add(TransformerConfiguration.CLASS_NAME, tc.getClassName());
+ if (tc.getProperties() != null && tc.getProperties().size() > 0) {
+ JsonObjectBuilder propBuilder = JsonLoader.createObjectBuilder();
+ tc.getProperties().forEach(propBuilder::add);
+ tcBuilder.add(TransformerConfiguration.PROPERTIES, propBuilder);
+ }
+ builder.add(TRANSFORMER_CONFIGURATION, tcBuilder);
+ }
+ builder.add(RETRY_INTERVAL, getRetryInterval());
+ builder.add(RETRY_INTERVAL_MULTIPLIER, getRetryIntervalMultiplier());
+ builder.add(INITIAL_CONNECT_ATTEMPTS, getInitialConnectAttempts());
+ builder.add(RECONNECT_ATTEMPTS, getReconnectAttempts());
+ builder.add(RECONNECT_ATTEMPTS_ON_SAME_NODE,
getReconnectAttemptsOnSameNode());
+ builder.add(USE_DUPLICATE_DETECTION, isUseDuplicateDetection());
+ builder.add(CONFIRMATION_WINDOW_SIZE, getConfirmationWindowSize());
+ builder.add(PRODUCER_WINDOW_SIZE, getProducerWindowSize());
+ builder.add(CLIENT_FAILURE_CHECK_PERIOD, getClientFailureCheckPeriod());
+ if (getUser() != null) {
+ builder.add(USER, getUser());
+ }
+ if (getPassword() != null) {
+ builder.add(PASSWORD, getPassword());
+ }
+ builder.add(CONNECTION_TTL, getConnectionTTL());
+ builder.add(MAX_RETRY_INTERVAL, getMaxRetryInterval());
+ builder.add(MIN_LARGE_MESSAGE_SIZE, getMinLargeMessageSize());
+ builder.add(CALL_TIMEOUT, getCallTimeout());
+ builder.add(ROUTING_TYPE, getRoutingType().name());
+
+ return builder.build().toString();
+ }
+
+ /**
+ * This method returns a {@code QueueConfiguration} created from the
JSON-formatted input {@code String}. The input
Review comment:
The JavaDoc references `QueueConfiguration`.
##########
File path:
artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
##########
@@ -3822,6 +3822,30 @@ public void createBridge(final String name,
}
}
+ @Override
+ public String createBridge(String bridgeConfigurationAsJson) throws
Exception {
+ if (AuditLogger.isEnabled()) {
+ AuditLogger.createBridge(this.server, bridgeConfigurationAsJson);
+ }
+ checkStarted();
+
+ clearIO();
+
+ try {
+ // when the QueueConfiguration is passed through createQueue all of
its defaults get set which we return to the caller
Review comment:
The comment references `QueueConfiguration`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 539428)
Time Spent: 2h (was: 1h 50m)
> Add ActiveMQServerControl#createBridge() method variant which accepts the
> callTimeout attribute
> -----------------------------------------------------------------------------------------------
>
> Key: ARTEMIS-3074
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3074
> Project: ActiveMQ Artemis
> Issue Type: Improvement
> Components: API
> Affects Versions: 2.16.0
> Reporter: Tomas Hofman
> Priority: Major
> Time Spent: 2h
> Remaining Estimate: 0h
>
> Currently there are four variants of the
> {{ActiveMQServerControl#createBridge()}} method, none of which accepts the
> {{callTimeout}} attribute of the core bridge.
> The {{callTimeout}} attribute sets a call timeout for blocking calls to the
> server. Typically a bridge works in a non-blocking manner, but in some cases
> customers use configurations where calls do block.
> It would still be possible to set call timeout without this change using
> lower level API ({{ActiveMQServer#deployBridge()}}), but it would require
> duplicating some code which is already there in {{ActiveMQServerControl}}.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)