Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
5dc9982
[AMQ-9737] activemq-spring: Remove references to schema namespaces pr…
mattrpav Jul 1, 2025
45be7ef
use StringBuilder instead of StringBuffer in join method
Jul 8, 2025
d22f719
rewrite some logging to use params instead of concatenation
Jul 8, 2025
3220a40
use StringBuilder instead of StringBuffer in validate method
Jul 8, 2025
77b5bf5
use StringBuilder instead of StringBuffer
Jul 8, 2025
2a38eeb
rewrite some logging to use params instead of concatenation
Jul 8, 2025
9b2864e
rewrite some logging to use params instead of concatenation
Jul 8, 2025
86c7e4e
use StringBuilder instead of StringBuffer
Jul 8, 2025
af7caaf
use StringBuilder instead of StringBuffer
Jul 8, 2025
1a6e280
use StringBuilder instead of StringBuffer
Jul 8, 2025
a1390ae
use StringBuilder instead of StringBuffer
Jul 8, 2025
167c8aa
use StringBuilder instead of StringBuffer
Jul 8, 2025
dde36ea
use StringBuilder instead of StringBuffer
Jul 8, 2025
9712e8a
avoid StringBuffer and use java 11 String#repeat
Jul 8, 2025
21b4672
use StringBuilder instead of StringBuffer
Jul 8, 2025
af147ac
use StringBuilder instead of StringBuffer in join method
Jul 8, 2025
89e2769
rewrite some logging to use params instead of concatenation
Jul 8, 2025
a052e40
use StringBuilder instead of StringBuffer in validate method
Jul 8, 2025
234113a
use StringBuilder instead of StringBuffer
Jul 8, 2025
3440022
rewrite some logging to use params instead of concatenation
Jul 8, 2025
d29677c
rewrite some logging to use params instead of concatenation
Jul 8, 2025
e968807
use StringBuilder instead of StringBuffer
Jul 8, 2025
acc4bd3
use StringBuilder instead of StringBuffer
Jul 8, 2025
67c34db
use StringBuilder instead of StringBuffer
Jul 8, 2025
b3e0b09
use StringBuilder instead of StringBuffer
Jul 8, 2025
677dd18
use StringBuilder instead of StringBuffer
Jul 8, 2025
856d802
use StringBuilder instead of StringBuffer
Jul 8, 2025
1342038
avoid StringBuffer and use java 11 String#repeat
Jul 8, 2025
37d61b8
use StringBuilder instead of StringBuffer
Jul 8, 2025
7c42719
Merge remote-tracking branch 'origin/feature/cleanup_part2_stringbuff…
Jul 9, 2025
8a8dc91
AMQ-9740: Web Console's form:short and form:text tags do not use comm…
sergio-d-lemos Jul 11, 2025
c2ebea7
Merge pull request #1464 from mattrpav/AMQ-9737
mattrpav Jul 14, 2025
f542568
[AMQ-9734] Remove support for deprecated Axion JDBC Support
mattrpav Jun 28, 2025
45043c8
Merge pull request #1463 from mattrpav/AMQ-9734
mattrpav Jul 14, 2025
de24a85
[AMQ-9735] Task: Remove unused josql dependency
mattrpav Jun 28, 2025
d8e9000
Merge pull request #1462 from mattrpav/AMQ-9735
mattrpav Jul 21, 2025
2eb0d66
AMQ-9747 - Handle IOExceptionHandler thrown exceptions in KahaDB (#1474)
cshannon Jul 23, 2025
388ed9a
Fix schedular typo (#1481)
ambersun1234 Aug 21, 2025
23e1030
Fix typo in docker-compose (#1475)
vojtakaniok Aug 21, 2025
35197b4
AMQ-9739: Removed "upgrade-insecure-requests" from the Web Console's …
sergio-d-lemos Aug 21, 2025
307c029
Merge pull request #1469 from sergio-d-lemos/AMQ-9740
mattrpav Sep 9, 2025
25bcf77
AMQ-9761 - Updating to Spring 6.2.10 (#1485)
coheigea Sep 10, 2025
eaa6d03
AMQ-9757: Upgrade to Apache POM 35 (#1482)
jbonofre Sep 10, 2025
4352d55
AMQ-9743: Fixes Web Console column sorting. (#1479)
sergio-d-lemos Sep 12, 2025
4e50e8d
[AMQ-9749] Update JaasDualAuthenticationBroker isSSL method to be pro…
mattrpav Jul 29, 2025
fb78188
AMQ-9767: Upgrade to jmdns 3.6.2 (#1486)
jbonofre Sep 12, 2025
54f2e88
refactored the test to use Mockito
kenliao94 Mar 14, 2025
718ce02
Fix verify stop
kenliao94 Mar 14, 2025
57b05b9
AMQ-9771: Enable security features when building XML Schema in active…
sergio-d-lemos Sep 18, 2025
b2a066b
Create list-github-hosted-runners.yml
mattrpav Sep 18, 2025
07220b1
Delete .github/workflows/list-github-hosted-runners.yml
mattrpav Sep 18, 2025
083a30e
AMQ-9762: Upgrade to Jackson 2.20.0 (#1492)
jbonofre Sep 25, 2025
0f2eac3
AMQ-9766: Upgrade to Jetty 11.0.26 (#1488)
jbonofre Sep 25, 2025
3fbd5a0
Bump org.springframework:spring-core from 6.2.10 to 6.2.11 (#1494)
dependabot[bot] Sep 25, 2025
ea5edb5
AMQ-9763: Upgrade to commons-io 2.20.0 (#1491)
jbonofre Sep 25, 2025
e5c29bd
AMQ-9764: Upgrade to Camel 4.14.0 (#1490)
jbonofre Sep 25, 2025
f68fff9
[AMQ-9768] Fix JMX value escaping in web console. (#1487)
thezbyg Sep 25, 2025
ec633b3
[AMQ-9773] Fix for only one message being recovered from backup
mattrpav Sep 24, 2025
96c92e4
[AMQ-9773-b] Update code comments for backup only recoverying one mes…
mattrpav Sep 26, 2025
273d8fb
[AMQ-9548] Add BrokerView attributes to retrieve number of total, man…
kenliao94 Sep 29, 2025
51553dd
AMQ-9718 Removed collections which are never queried (#1444)
dk2k Sep 29, 2025
edd358d
[AMQ-9394] Tech Preview: Virtual Thread support
mattrpav Mar 5, 2024
56ea235
[AMQ-9777] Migrate to using multi-release jar for activemq-client
mattrpav Oct 2, 2025
587bd4f
AMQ-9746: Upgrade to Jolokia 2.3.0 (#1502)
jbonofre Oct 4, 2025
59d7567
use StringBuilder instead of StringBuffer in join method
Jul 8, 2025
aa9bb70
rewrite some logging to use params instead of concatenation
Jul 8, 2025
abd6727
use StringBuilder instead of StringBuffer in validate method
Jul 8, 2025
322ee39
use StringBuilder instead of StringBuffer
Jul 8, 2025
83e8284
rewrite some logging to use params instead of concatenation
Jul 8, 2025
ca3c560
rewrite some logging to use params instead of concatenation
Jul 8, 2025
9094e01
use StringBuilder instead of StringBuffer
Jul 8, 2025
81fe4a4
use StringBuilder instead of StringBuffer
Jul 8, 2025
2de1072
use StringBuilder instead of StringBuffer
Jul 8, 2025
ab35359
use StringBuilder instead of StringBuffer
Jul 8, 2025
03c707e
use StringBuilder instead of StringBuffer
Jul 8, 2025
5497d93
use StringBuilder instead of StringBuffer
Jul 8, 2025
b324282
avoid StringBuffer and use java 11 String#repeat
Jul 8, 2025
16aa5af
use StringBuilder instead of StringBuffer
Jul 8, 2025
2674b36
Merge remote-tracking branch 'grigoni/feature/cleanup_part2_stringbuf…
Oct 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@
*/
package org.apache.activemq.transport.amqp.client.sasl;

import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;

import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import javax.security.sasl.SaslException;

import static java.nio.charset.StandardCharsets.US_ASCII;

/**
* Implements the SASL PLAIN authentication Mechanism.
*
* User name and Password values are sent without being encrypted.
*/
public class CramMD5Mechanism extends AbstractMechanism {

private static final String ASCII = "ASCII";
private static final String HMACMD5 = "HMACMD5";
private boolean sentResponse;

Expand All @@ -54,26 +54,25 @@ public byte[] getInitialResponse() {
public byte[] getChallengeResponse(byte[] challenge) throws SaslException {
if (!sentResponse && challenge != null && challenge.length != 0) {
try {
SecretKeySpec key = new SecretKeySpec(getPassword().getBytes(ASCII), HMACMD5);
SecretKeySpec key = new SecretKeySpec(getPassword().getBytes(US_ASCII), HMACMD5);
Mac mac = Mac.getInstance(HMACMD5);
mac.init(key);

byte[] bytes = mac.doFinal(challenge);

StringBuffer hash = new StringBuffer(getUsername());
StringBuilder hash = new StringBuilder((bytes.length * 2) + 64);
hash.append(getUsername());
hash.append(' ');
for (int i = 0; i < bytes.length; i++) {
String hex = Integer.toHexString(0xFF & bytes[i]);
for (byte aByte : bytes) {
String hex = Integer.toHexString(0xFF & aByte);
if (hex.length() == 1) {
hash.append('0');
}
hash.append(hex);
}

sentResponse = true;
return hash.toString().getBytes(ASCII);
} catch (UnsupportedEncodingException e) {
throw new SaslException("Unable to utilise required encoding", e);
return hash.toString().getBytes(US_ASCII);
} catch (InvalidKeyException e) {
throw new SaslException("Unable to utilise key", e);
} catch (NoSuchAlgorithmException e) {
Expand All @@ -86,6 +85,6 @@ public byte[] getChallengeResponse(byte[] challenge) throws SaslException {

@Override
public boolean isApplicable(String username, String password) {
return username != null && username.length() > 0 && password != null && password.length() > 0;
return username != null && !username.isEmpty() && password != null && !password.isEmpty();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
import java.beans.BeanInfo;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Method;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
Expand Down Expand Up @@ -85,7 +85,7 @@ public static URI replaceQuery(URI uri, String query) throws URISyntaxException
if (questionMark > 0) {
schemeSpecificPart = schemeSpecificPart.substring(0, questionMark);
}
if (query != null && query.length() > 0) {
if (query != null && !query.isEmpty()) {
schemeSpecificPart += "?" + query;
}
return new URI(uri.getScheme(), schemeSpecificPart, uri.getFragment());
Expand Down Expand Up @@ -116,27 +116,23 @@ public static URI eraseQuery(URI uri) throws URISyntaxException {
*
* @throws URISyntaxException if the given URI is invalid.
*/
public static String createQueryString(Map<String, ? extends Object> options) throws URISyntaxException {
try {
if (options.size() > 0) {
StringBuffer rc = new StringBuffer();
boolean first = true;
for (Entry<String, ? extends Object> entry : options.entrySet()) {
if (first) {
first = false;
} else {
rc.append("&");
}
rc.append(URLEncoder.encode(entry.getKey(), "UTF-8"));
rc.append("=");
rc.append(URLEncoder.encode((String) entry.getValue(), "UTF-8"));
public static String createQueryString(Map<String, ? extends Object> options) {
if (!options.isEmpty()) {
StringBuilder rc = new StringBuilder();
boolean first = true;
for (Entry<String, ? extends Object> entry : options.entrySet()) {
if (first) {
first = false;
} else {
rc.append("&");
}
return rc.toString();
} else {
return "";
rc.append(URLEncoder.encode(entry.getKey(), StandardCharsets.UTF_8));
rc.append("=");
rc.append(URLEncoder.encode((String) entry.getValue(), StandardCharsets.UTF_8));
}
} catch (UnsupportedEncodingException e) {
throw (URISyntaxException) new URISyntaxException(e.toString(), "Invalid encoding").initCause(e);
return rc.toString();
} else {
return "";
}
}

Expand Down Expand Up @@ -196,8 +192,8 @@ public static Map<String, String> parseQuery(String queryString) throws Exceptio
for (int i = 0; i < parameters.length; i++) {
int p = parameters[i].indexOf("=");
if (p >= 0) {
String name = URLDecoder.decode(parameters[i].substring(0, p), "UTF-8");
String value = URLDecoder.decode(parameters[i].substring(p + 1), "UTF-8");
String name = URLDecoder.decode(parameters[i].substring(0, p), StandardCharsets.UTF_8);
String value = URLDecoder.decode(parameters[i].substring(p + 1), StandardCharsets.UTF_8);
rc.put(name, value);
} else {
rc.put(parameters[i], null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ public static String convertToString(String[] value) {
return null;
}

StringBuffer result = new StringBuffer(String.valueOf(value[0]));
StringBuilder result = new StringBuilder(value.length * 2);
result.append(value[0]);
for (int i = 1; i < value.length; i++) {
result.append(",").append(value[i]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import org.apache.activemq.ConfigurationException;
import org.apache.activemq.Service;
import org.apache.activemq.advisory.AdvisoryBroker;
import org.apache.activemq.annotation.Experimental;
import org.apache.activemq.broker.cluster.ConnectionSplitBroker;
import org.apache.activemq.broker.jmx.AnnotatedMBean;
import org.apache.activemq.broker.jmx.BrokerMBeanSupport;
Expand Down Expand Up @@ -223,6 +224,7 @@ public class BrokerService implements Service {
private boolean monitorConnectionSplits = false;
private int taskRunnerPriority = Thread.NORM_PRIORITY;
private boolean dedicatedTaskRunner;
private boolean virtualThreadTaskRunner;
private boolean cacheTempDestinations = false;// useful for failover
private int timeBeforePurgeTempDestinations = 5000;
private final List<Runnable> shutdownHooks = new ArrayList<>();
Expand Down Expand Up @@ -1269,7 +1271,7 @@ public void setPersistenceAdapter(PersistenceAdapter persistenceAdapter) throws
public TaskRunnerFactory getTaskRunnerFactory() {
if (this.taskRunnerFactory == null) {
this.taskRunnerFactory = new TaskRunnerFactory("ActiveMQ BrokerService["+getBrokerName()+"] Task", getTaskRunnerPriority(), true, 1000,
isDedicatedTaskRunner());
isDedicatedTaskRunner(), isVirtualThreadTaskRunner());
this.taskRunnerFactory.setThreadClassLoader(this.getClass().getClassLoader());
}
return this.taskRunnerFactory;
Expand All @@ -1280,9 +1282,10 @@ public void setTaskRunnerFactory(TaskRunnerFactory taskRunnerFactory) {
}

public TaskRunnerFactory getPersistenceTaskRunnerFactory() {
// [AMQ-9394] TODO: Should we have a separate config flag for virtualThread for persistence task runner?
if (taskRunnerFactory == null) {
persistenceTaskRunnerFactory = new TaskRunnerFactory("Persistence Adaptor Task", persistenceThreadPriority,
true, 1000, isDedicatedTaskRunner());
true, 1000, isDedicatedTaskRunner(), isVirtualThreadTaskRunner());
}
return persistenceTaskRunnerFactory;
}
Expand Down Expand Up @@ -1891,6 +1894,15 @@ public void setDedicatedTaskRunner(boolean dedicatedTaskRunner) {
this.dedicatedTaskRunner = dedicatedTaskRunner;
}

public boolean isVirtualThreadTaskRunner() {
return virtualThreadTaskRunner;
}

@Experimental("Tech Preview for Virtaul Thread support")
public void setVirtualThreadTaskRunner(boolean virtualThreadTaskRunner) {
this.virtualThreadTaskRunner = virtualThreadTaskRunner;
}

public boolean isCacheTempDestinations() {
return cacheTempDestinations;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,41 @@ public ObjectName[] getTopics() {
return safeGetBroker().getTopicsNonSuppressed();
}

@Override
public int getTotalTopicsCount() {
return safeGetBroker().getTopicRegion().getDestinationMap().size();
}

@Override
public int getTotalManagedTopicsCount() {
return safeGetBroker().getTopicsNonSuppressed().length;
}

@Override
public int getTotalTemporaryTopicsCount() {
return safeGetBroker().getTempTopicRegion().getDestinationMap().size();
}

@Override
public ObjectName[] getQueues() {
return safeGetBroker().getQueuesNonSuppressed();
}

@Override
public int getTotalQueuesCount() {
return safeGetBroker().getQueueRegion().getDestinationMap().size();
}

@Override
public int getTotalManagedQueuesCount() {
return safeGetBroker().getQueuesNonSuppressed().length;
}

@Override
public int getTotalTemporaryQueuesCount() {
return safeGetBroker().getTempQueueRegion().getDestinationMap().size();
}

@Override
public String queryQueues(String filter, int page, int pageSize) throws IOException {
return DestinationsViewFilter.create(filter)
Expand Down Expand Up @@ -517,6 +547,16 @@ public boolean isSlave() {
return brokerService.isSlave();
}

@Override
public boolean isDedicatedTaskRunner() {
return brokerService.isDedicatedTaskRunner();
}

@Override
public boolean isVirtualThreadTaskRunner() {
return brokerService.isVirtualThreadTaskRunner();
}

private ManagedRegionBroker safeGetBroker() {
if (broker == null) {
throw new IllegalStateException("Broker is not yet started.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,27 @@ public interface BrokerViewMBean extends Service {
@MBeanInfo("Topics (broadcasted 'queues'); generally system information.")
ObjectName[] getTopics();

@MBeanInfo("Total number of topics")
int getTotalTopicsCount();

@MBeanInfo("Total number of non suppressed topics")
int getTotalManagedTopicsCount();

@MBeanInfo("Total number of temporary topics")
int getTotalTemporaryTopicsCount();

@MBeanInfo("Standard Queues containing AIE messages.")
ObjectName[] getQueues();

@MBeanInfo("Total number of queues")
int getTotalQueuesCount();

@MBeanInfo("Total number of non suppressed queues")
int getTotalManagedQueuesCount();

@MBeanInfo("Total number of temporary queues")
int getTotalTemporaryQueuesCount();

/**
* Queue Query API, take a look at {@link DestinationsViewFilter} for more information
*/
Expand Down Expand Up @@ -335,4 +353,11 @@ public interface BrokerViewMBean extends Service {

@MBeanInfo(value="The total number of times that the max number of uncommitted count has been exceeded across all destinations")
long getTotalMaxUncommittedExceededCount();

@MBeanInfo("Dedicated Task Runner enabled.")
boolean isDedicatedTaskRunner();

@MBeanInfo("Virtual Thread Task Runner enabled.")
boolean isVirtualThreadTaskRunner();

}
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,10 @@ public void send(ProducerBrokerExchange producerExchange, final Message messageS
final Object delayValue = messageSend.getProperty(ScheduledMessage.AMQ_SCHEDULED_DELAY);

String physicalName = messageSend.getDestination().getPhysicalName();
boolean schedularManage = physicalName.regionMatches(true, 0, ScheduledMessage.AMQ_SCHEDULER_MANAGEMENT_DESTINATION, 0,
boolean schedulerManage = physicalName.regionMatches(true, 0, ScheduledMessage.AMQ_SCHEDULER_MANAGEMENT_DESTINATION, 0,
ScheduledMessage.AMQ_SCHEDULER_MANAGEMENT_DESTINATION.length());

if (schedularManage == true) {
if (schedulerManage == true) {

JobScheduler scheduler = getInternalScheduler();
ActiveMQDestination replyTo = messageSend.getReplyTo();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public void removeConnection(ConnectionContext context, ConnectionInfo info, Thr
}
}

private boolean isSSL(ConnectionContext context, ConnectionInfo info) throws Exception {
protected boolean isSSL(ConnectionContext context, ConnectionInfo info) throws Exception {
boolean sslCapable = false;
Connector connector = context.getConnector();
if (connector instanceof TransportConnector) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,9 @@ private PListEntry getFirst(PList plist) throws IOException {
}

protected void doTestRemove(final int COUNT) throws IOException {
Map<String, ByteSequence> map = new LinkedHashMap<String, ByteSequence>();
for (int i = 0; i < COUNT; i++) {
String test = new String("test" + i);
ByteSequence bs = new ByteSequence(test.getBytes());
map.put(test, bs);
plist.addLast(test, bs);
}
assertEquals(plist.size(), COUNT);
Expand Down
33 changes: 33 additions & 0 deletions activemq-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -200,15 +200,21 @@
<configuration>
<instructions>
<Import-Package>
!java.*,
!javax.naming*,
!javax.net*,
!org.apache.activemq*,
!com.google.errorprone.annotations,
!com.google.errorprone.annotations.concurrent,
com.thoughtworks.xstream.*;resolution:="optional",
javax.jmdns.*;resolution:="optional",
*
</Import-Package>
<Private-Package>
com.google.errorprone.annotations,
com.google.errorprone.annotations.concurrent
</Private-Package>
<Multi-Release>true</Multi-Release>
<_noee>true</_noee>
</instructions>
</configuration>
Expand Down Expand Up @@ -396,5 +402,32 @@
</plugins>
</build>
</profile>
<profile>
<id>jdk21-plus</id>
<activation>
<jdk>[21,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>java21-compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<release>21</release> <!-- Specific Java version for alternative classes -->
<compileSourceRoots>${project.basedir}/src/main/java21</compileSourceRoots>
<multiReleaseOutput>true</multiReleaseOutput>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Loading