[jira] [Assigned] (ARTEMIS-4588) Queue Federation and large messages move slowdown

2024-02-08 Thread Justin Bertram (Jira)


 [ 
https://issues.apache.org/jira/browse/ARTEMIS-4588?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Justin Bertram reassigned ARTEMIS-4588:
---

Assignee: Justin Bertram

> Queue Federation and large messages move slowdown
> -
>
> Key: ARTEMIS-4588
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4588
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>  Components: Broker, Federation
>Affects Versions: 2.30.0
>Reporter: Jean-Pascal Briquet
>Assignee: Justin Bertram
>Priority: Major
> Attachments: federation-large-message-testcase.java
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> *Artemis configuration:* 
> Artemis configured with a dual queue federation link on Artemis and 
> requirement to support via this federation link standard messages and large 
> messages (between 100kb and 500kb).
>  
> *What is happening:*
> When a consumer is created, one or two large messages are consumed instantly 
> thanks to the federation but next messages are received very slowly and 
> arrive one by one after a delay of 30s.
> The queue federation works well with standard messages and does not have any 
> pause between message consumption.
> The delay between each message consumed looks to be coming from the 
> call-timeout property set on the federation upstream, when changing its 
> value, it changes the pause/delay between large messages consumption.
>  
> *Reproduction*
> A test case is attached and can be run by adding it into 
> "tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/federation/FederatedQueueTest.java"
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Work logged] (ARTEMIS-4639) Artemis Cluster and NullpointerException in "sending topology"

2024-02-08 Thread ASF GitHub Bot (Jira)


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

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

Author: ASF GitHub Bot
Created on: 08/Feb/24 17:35
Start Date: 08/Feb/24 17:35
Worklog Time Spent: 10m 
  Work Description: gemmellr commented on code in PR #4814:
URL: https://github.com/apache/activemq-artemis/pull/4814#discussion_r1483352682


##
artemis-protocols/artemis-openwire-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/openwire/amq/OpenWireProtocolManagerTest.java:
##
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.core.protocol.openwire.amq;
+
+import java.util.concurrent.Executors;
+
+import io.netty.buffer.Unpooled;
+import org.apache.activemq.artemis.api.core.client.TopologyMember;
+import org.apache.activemq.artemis.core.buffers.impl.ChannelBufferWrapper;
+import org.apache.activemq.artemis.core.client.impl.TopologyMemberImpl;
+import org.apache.activemq.artemis.core.persistence.StorageManager;
+import 
org.apache.activemq.artemis.core.persistence.impl.nullpm.NullStorageManager;
+import org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection;
+import 
org.apache.activemq.artemis.core.protocol.openwire.OpenWireProtocolManager;
+import org.apache.activemq.artemis.core.security.SecurityStore;
+import org.apache.activemq.artemis.core.server.ActiveMQServer;
+import org.apache.activemq.artemis.core.server.ServerSession;
+import org.apache.activemq.artemis.core.server.cluster.ClusterManager;
+import org.apache.activemq.artemis.spi.core.remoting.Connection;
+import org.apache.activemq.artemis.utils.ActiveMQThreadFactory;
+import org.apache.activemq.artemis.utils.RandomUtil;
+import org.apache.activemq.artemis.utils.actors.ArtemisExecutor;
+import org.apache.activemq.command.ConnectionId;
+import org.apache.activemq.command.ConnectionInfo;
+import org.junit.Test;
+import org.mockito.Mockito;
+
+public class OpenWireProtocolManagerTest {
+
+   @Test
+   public void testNullPrimaryOnNodeUp() throws Exception {
+
+  ArtemisExecutor executor = 
ArtemisExecutor.delegate(Executors.newSingleThreadExecutor(ActiveMQThreadFactory.defaultThreadFactory(getClass().getName(;
+
+  ClusterManager clusterManager = Mockito.mock(ClusterManager.class);
+  ActiveMQServer server = Mockito.mock(ActiveMQServer.class);
+  StorageManager storageManager = new NullStorageManager();
+  Mockito.when(server.getStorageManager()).thenReturn(storageManager);
+  
Mockito.when(server.newOperationContext()).thenReturn(storageManager.newContext(executor));
+  Mockito.when(server.getClusterManager()).thenReturn(clusterManager);
+  
Mockito.when(clusterManager.getDefaultConnection(Mockito.any())).thenReturn(null);
+  SecurityStore securityStore = Mockito.mock(SecurityStore.class);
+  Mockito.when(server.getSecurityStore()).thenReturn(securityStore);
+  Mockito.when(securityStore.authenticate(Mockito.any(), Mockito.any(), 
Mockito.any(), Mockito.any())).thenReturn(null);
+  ServerSession serverSession = Mockito.mock(ServerSession.class);
+  Mockito.when(serverSession.getName()).thenReturn("session");
+  
Mockito.doReturn(serverSession).when(server).createSession(Mockito.anyString(), 
Mockito.any(), Mockito.any(), Mockito.anyInt(), Mockito.any(), 
Mockito.anyBoolean(), Mockito.anyBoolean(), Mockito.anyBoolean(),
+ 
Mockito.anyBoolean(), Mockito.any(), Mockito.any(), Mockito.anyBoolean(), 
Mockito.any(), Mockito.any(), Mockito.anyString(), Mockito.any(), 
Mockito.anyBoolean());
+
+  OpenWireProtocolManager openWireProtocolManager = new 
OpenWireProtocolManager(null, server,null, null);
+  openWireProtocolManager.setSecurityDomain("securityDomain");
+  openWireProtocolManager.setSupportAdvisory(false);
+  Connection connection = Mockito.mock(Connection.class);
+  Mockito.doReturn(new 

[jira] [Work logged] (ARTEMIS-4639) Artemis Cluster and NullpointerException in "sending topology"

2024-02-08 Thread ASF GitHub Bot (Jira)


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

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

Author: ASF GitHub Bot
Created on: 08/Feb/24 17:35
Start Date: 08/Feb/24 17:35
Worklog Time Spent: 10m 
  Work Description: gemmellr commented on code in PR #4814:
URL: https://github.com/apache/activemq-artemis/pull/4814#discussion_r1483352682


##
artemis-protocols/artemis-openwire-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/openwire/amq/OpenWireProtocolManagerTest.java:
##
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.core.protocol.openwire.amq;
+
+import java.util.concurrent.Executors;
+
+import io.netty.buffer.Unpooled;
+import org.apache.activemq.artemis.api.core.client.TopologyMember;
+import org.apache.activemq.artemis.core.buffers.impl.ChannelBufferWrapper;
+import org.apache.activemq.artemis.core.client.impl.TopologyMemberImpl;
+import org.apache.activemq.artemis.core.persistence.StorageManager;
+import 
org.apache.activemq.artemis.core.persistence.impl.nullpm.NullStorageManager;
+import org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection;
+import 
org.apache.activemq.artemis.core.protocol.openwire.OpenWireProtocolManager;
+import org.apache.activemq.artemis.core.security.SecurityStore;
+import org.apache.activemq.artemis.core.server.ActiveMQServer;
+import org.apache.activemq.artemis.core.server.ServerSession;
+import org.apache.activemq.artemis.core.server.cluster.ClusterManager;
+import org.apache.activemq.artemis.spi.core.remoting.Connection;
+import org.apache.activemq.artemis.utils.ActiveMQThreadFactory;
+import org.apache.activemq.artemis.utils.RandomUtil;
+import org.apache.activemq.artemis.utils.actors.ArtemisExecutor;
+import org.apache.activemq.command.ConnectionId;
+import org.apache.activemq.command.ConnectionInfo;
+import org.junit.Test;
+import org.mockito.Mockito;
+
+public class OpenWireProtocolManagerTest {
+
+   @Test
+   public void testNullPrimaryOnNodeUp() throws Exception {
+
+  ArtemisExecutor executor = 
ArtemisExecutor.delegate(Executors.newSingleThreadExecutor(ActiveMQThreadFactory.defaultThreadFactory(getClass().getName(;
+
+  ClusterManager clusterManager = Mockito.mock(ClusterManager.class);
+  ActiveMQServer server = Mockito.mock(ActiveMQServer.class);
+  StorageManager storageManager = new NullStorageManager();
+  Mockito.when(server.getStorageManager()).thenReturn(storageManager);
+  
Mockito.when(server.newOperationContext()).thenReturn(storageManager.newContext(executor));
+  Mockito.when(server.getClusterManager()).thenReturn(clusterManager);
+  
Mockito.when(clusterManager.getDefaultConnection(Mockito.any())).thenReturn(null);
+  SecurityStore securityStore = Mockito.mock(SecurityStore.class);
+  Mockito.when(server.getSecurityStore()).thenReturn(securityStore);
+  Mockito.when(securityStore.authenticate(Mockito.any(), Mockito.any(), 
Mockito.any(), Mockito.any())).thenReturn(null);
+  ServerSession serverSession = Mockito.mock(ServerSession.class);
+  Mockito.when(serverSession.getName()).thenReturn("session");
+  
Mockito.doReturn(serverSession).when(server).createSession(Mockito.anyString(), 
Mockito.any(), Mockito.any(), Mockito.anyInt(), Mockito.any(), 
Mockito.anyBoolean(), Mockito.anyBoolean(), Mockito.anyBoolean(),
+ 
Mockito.anyBoolean(), Mockito.any(), Mockito.any(), Mockito.anyBoolean(), 
Mockito.any(), Mockito.any(), Mockito.anyString(), Mockito.any(), 
Mockito.anyBoolean());
+
+  OpenWireProtocolManager openWireProtocolManager = new 
OpenWireProtocolManager(null, server,null, null);
+  openWireProtocolManager.setSecurityDomain("securityDomain");
+  openWireProtocolManager.setSupportAdvisory(false);
+  Connection connection = Mockito.mock(Connection.class);
+  Mockito.doReturn(new 

[jira] [Work logged] (ARTEMIS-4639) Artemis Cluster and NullpointerException in "sending topology"

2024-02-08 Thread ASF GitHub Bot (Jira)


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

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

Author: ASF GitHub Bot
Created on: 08/Feb/24 13:37
Start Date: 08/Feb/24 13:37
Worklog Time Spent: 10m 
  Work Description: gemmellr commented on code in PR #4814:
URL: https://github.com/apache/activemq-artemis/pull/4814#discussion_r1482975720


##
artemis-server/src/test/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImplMockTest.java:
##
@@ -85,6 +93,53 @@ public void testRemvalOfLocalParameters() throws Exception {
 
}
 
+   @Test
+   public void testNullPrimaryOnNodeUp() throws Exception {
+  TransportConfiguration tc = new TransportConfiguration();
+  tc.setFactoryClassName("mock");
+  tc.getParams().put(TransportConstants.LOCAL_ADDRESS_PROP_NAME, 
"localAddress");
+  tc.getParams().put(TransportConstants.LOCAL_PORT_PROP_NAME, "localPort");
+
+  ArtemisExecutor executor = 
ArtemisExecutor.delegate(Executors.newSingleThreadExecutor(ActiveMQThreadFactory.defaultThreadFactory(getClass().getName(;
+
+  ClusterConnectionImpl cci = new ClusterConnectionImpl(
+ null, //final ClusterManager manager,
+ new TransportConfiguration[]{tc}, //final TransportConfiguration[] 
staticTranspConfigs,
+ null, //final TransportConfiguration connector,
+ null, //final SimpleString name,
+ null, //final SimpleString address,
+ 0, //final int minLargeMessageSize,
+ 0L, //final long clientFailureCheckPeriod,
+ 0L, //final long connectionTTL,
+ 0L, //final long retryInterval,
+ 0, //final double retryIntervalMultiplier,
+ 0L, //final long maxRetryInterval,
+ 0, //final int initialConnectAttempts,
+ 0, //final int reconnectAttempts,
+ 0L, //final long callTimeout,
+ 0L, //final long callFailoverTimeout,
+ false, //final boolean useDuplicateDetection,
+ null, //final MessageLoadBalancingType messageLoadBalancingType,
+ 0, //final int confirmationWindowSize,
+ 0, //final int producerWindowSize,
+ () -> executor,//final ExecutorFactory executorFactory,
+ new MockServer(), //final ActiveMQServer server,
+ null, //final PostOffice postOffice,
+ null, //final ManagementService managementService,
+ null, //final ScheduledExecutorService scheduledExecutor,
+ 0, //final int maxHops,
+ new 
FakeNodeManager(UUIDGenerator.getInstance().generateStringUUID()), //final 
NodeManager nodeManager,
+ null, //final String clusterUser,
+ null, //final String clusterPassword,
+ true, //final boolean allowDirectConnectionsOnly,
+ 0, //final long clusterNotificationInterval,
+ 0 //final int clusterNotificationAttempts)

Review Comment:
   Does the commented out parameter code really add enough to warrant keeping 
the cruft? It will just go stale as people rework the impl. Even assigning all 
the actual variables would probably look nicer (if more verbose..though many 
could probably be multi-assigned to reduce line count). The values are mostly 
essentially 0/null/false except a small subset. Maybe just comment ones that 
are particularly noteworthy?



##
artemis-server/src/test/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImplMockTest.java:
##
@@ -85,6 +93,53 @@ public void testRemvalOfLocalParameters() throws Exception {
 
}
 
+   @Test
+   public void testNullPrimaryOnNodeUp() throws Exception {
+  TransportConfiguration tc = new TransportConfiguration();
+  tc.setFactoryClassName("mock");
+  tc.getParams().put(TransportConstants.LOCAL_ADDRESS_PROP_NAME, 
"localAddress");
+  tc.getParams().put(TransportConstants.LOCAL_PORT_PROP_NAME, "localPort");
+
+  ArtemisExecutor executor = 
ArtemisExecutor.delegate(Executors.newSingleThreadExecutor(ActiveMQThreadFactory.defaultThreadFactory(getClass().getName(;

Review Comment:
   What shuts this down?



##
artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java:
##
@@ -232,6 +232,13 @@ public OpenWireProtocolManager 
setOpenwireUseDuplicateDetectionOnFailover(boolea
 
@Override
public void nodeUP(TopologyMember member, boolean last) {
+  if (member.getPrimary() == null) {
+ if (logger.isTraceEnabled()) {
+logger.trace("{} ignoring call with nodeID={}, topologyMember={}, 
last={}", this, member.getNodeId(), member, last);

Review Comment:
   Maybe say what call is being ignored, and why?



##

[jira] [Resolved] (ARTEMIS-4640) move extension added to aid 'offline' maven usage into a profile

2024-02-08 Thread Robbie Gemmell (Jira)


 [ 
https://issues.apache.org/jira/browse/ARTEMIS-4640?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robbie Gemmell resolved ARTEMIS-4640.
-
Resolution: Fixed

> move extension added to aid 'offline' maven usage into a profile
> 
>
> Key: ARTEMIS-4640
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4640
> Project: ActiveMQ Artemis
>  Issue Type: Task
>Affects Versions: 2.32.0
>Reporter: Robbie Gemmell
>Assignee: Robbie Gemmell
>Priority: Major
> Fix For: 2.33.0
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> The changes in ARTEMIS-4153 to broke the reproducibility of the 
> artemis-commons module build. The extension being present leads to 
> OS-specific properties being embedded in the published pom, e.g see 
> https://repo1.maven.org/maven2/org/apache/activemq/artemis-commons/2.32.0/artemis-commons-2.32.0.pom
> The extension will be moved into a helper 'go-offline' profile so it can 
> still be used easily together with go-offline, even though its usefulness 
> actually seems limited.
> Even after running dependency:go-offline with a clean local repo, the build 
> doesnt actually immediately work offline since that doesnt actually grab 
> everything needed at build time. You still need to run the build online to 
> get the added bits needed.
> Instead, just running then normal build itself initially, it then does work 
> offline.
> (Its also questionable if dependency:go-offline will actually be around in 
> future, a Jira was already raised to remove it due to various issues with it: 
> MDEP-904 )



--
This message was sent by Atlassian Jira
(v8.20.10#820010)