Skip to content

Commit 4ca0827

Browse files
Merge branch 'apache:main' into main
2 parents 4a7821c + 9964c95 commit 4ca0827

File tree

174 files changed

+5084
-1372
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+5084
-1372
lines changed

Jenkinsfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pipeline {
4343

4444
parameters {
4545
choice(name: 'nodeLabel', choices: ['ubuntu', 's390x', 'arm', 'Windows'])
46-
choice(name: 'jdkVersion', choices: ['jdk_17_latest', 'jdk_21_latest', 'jdk_22_latest', 'jdk_17_latest_windows', 'jdk_21_latest_windows', 'jdk_22_latest_windows'])
46+
choice(name: 'jdkVersion', choices: ['jdk_17_latest', 'jdk_21_latest', 'jdk_23_latest', 'jdk_17_latest_windows', 'jdk_21_latest_windows', 'jdk_23_latest_windows'])
4747
booleanParam(name: 'deployEnabled', defaultValue: false)
4848
booleanParam(name: 'sonarEnabled', defaultValue: false)
4949
booleanParam(name: 'testsEnabled', defaultValue: true)
@@ -72,12 +72,12 @@ pipeline {
7272
}
7373
}
7474

75-
stage('Build JDK 22') {
75+
stage('Build JDK 23') {
7676
tools {
77-
jdk "jdk_22_latest"
77+
jdk "jdk_23_latest"
7878
}
7979
steps {
80-
echo 'Building JDK 22'
80+
echo 'Building JDK 23'
8181
sh 'java -version'
8282
sh 'mvn -version'
8383
sh 'mvn -U -B -e clean install -DskipTests'
@@ -147,7 +147,7 @@ pipeline {
147147
}
148148
when {
149149
expression {
150-
params.deployEnabled && env.BRANCH_NAME ==~ /(activemq-5.18.x|activemq-5.17.x|main)/
150+
params.deployEnabled && env.BRANCH_NAME ==~ /(activemq-5.19.x|activemq-6.1.x|main)/
151151
}
152152
}
153153
steps {
@@ -176,7 +176,7 @@ pipeline {
176176
// If this build failed, send an email to the list.
177177
failure {
178178
script {
179-
if(env.BRANCH_NAME == "activemq-5.18.x" || env.BRANCH_NAME == "activemq-6.1.x" || env.BRANCH_NAME == "main") {
179+
if(env.BRANCH_NAME == "activemq-5.19.x" || env.BRANCH_NAME == "activemq-6.1.x" || env.BRANCH_NAME == "main") {
180180
emailext(
181181
subject: "[BUILD-FAILURE]: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
182182
body: """
@@ -193,7 +193,7 @@ Check console output at "<a href="${env.BUILD_URL}">${env.JOB_NAME} [${env.BRANC
193193
// If this build didn't fail, but there were failing tests, send an email to the list.
194194
unstable {
195195
script {
196-
if(env.BRANCH_NAME == "activemq-5.18.x" || env.BRANCH_NAME == "activemq-6.1.x" || env.BRANCH_NAME == "main") {
196+
if(env.BRANCH_NAME == "activemq-5.19.x" || env.BRANCH_NAME == "activemq-6.1.x" || env.BRANCH_NAME == "main") {
197197
emailext(
198198
subject: "[BUILD-UNSTABLE]: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
199199
body: """
@@ -213,7 +213,7 @@ Check console output at "<a href="${env.BUILD_URL}">${env.JOB_NAME} [${env.BRANC
213213
// (in this cae we probably don't have to do any post-build analysis)
214214
deleteDir()
215215
script {
216-
if ((env.BRANCH_NAME == "activemq-5.18.x" || env.BRANCH_NAME == "activemq-6.1.x" || env.BRANCH_NAME == "main") && (currentBuild.previousBuild != null) && (currentBuild.previousBuild.result != 'SUCCESS')) {
216+
if ((env.BRANCH_NAME == "activemq-5.19.x" || env.BRANCH_NAME == "activemq-6.1.x" || env.BRANCH_NAME == "main") && (currentBuild.previousBuild != null) && (currentBuild.previousBuild.result != 'SUCCESS')) {
217217
emailext (
218218
subject: "[BUILD-STABLE]: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
219219
body: """

activemq-all/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
<plugin>
7373
<groupId>org.apache.maven.plugins</groupId>
7474
<artifactId>maven-shade-plugin</artifactId>
75-
<version>${maven-shade-plugin-version}</version>
7675
<executions>
7776
<execution>
7877
<phase>package</phase>

activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpNioSslTransport.java

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,22 @@ public AmqpNioSslTransport(WireFormat wireFormat, Socket socket,
5454
@Override
5555
protected void initializeStreams() throws IOException {
5656
super.initializeStreams();
57+
if (initBuffer != null) {
58+
initBuffer.buffer.flip();
59+
// If we are processing the initial buffer from the auto transport,
60+
// then process first. This generally should only have 8 bytes from
61+
// the initial read
62+
if (initBuffer.buffer.hasRemaining()) {
63+
receiveCounter.addAndGet(initBuffer.readSize);
64+
try {
65+
// one call is all that is needed to consume all data
66+
processCommand(initBuffer.buffer);
67+
} catch (Exception e) {
68+
throw new IOException(e);
69+
}
70+
initBuffer.buffer.clear();
71+
}
72+
}
5773
if (inputBuffer.position() != 0 && inputBuffer.hasRemaining()) {
5874
serviceRead();
5975
}
@@ -76,23 +92,4 @@ protected void doInit() throws Exception {
7692
super.doInit();
7793
}
7894

79-
@Override
80-
protected int secureRead(ByteBuffer plain) throws Exception {
81-
if (initBuffer != null) {
82-
initBuffer.buffer.flip();
83-
if (initBuffer.buffer.hasRemaining()) {
84-
plain.flip();
85-
for (int i =0; i < 8; i++) {
86-
plain.put(initBuffer.buffer.get());
87-
}
88-
plain.flip();
89-
processCommand(plain);
90-
initBuffer.buffer.clear();
91-
return 8;
92-
}
93-
}
94-
return super.secureRead(plain);
95-
}
96-
97-
98-
}
95+
}

activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpNioTransport.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ private void serviceRead() {
140140
}
141141

142142
protected void processBuffer(ByteBuffer buffer, int readSize) throws Exception {
143-
receiveCounter += readSize;
143+
receiveCounter.addAndGet(readSize);
144144

145145
buffer.flip();
146146
frameReader.parse(buffer);
@@ -164,4 +164,4 @@ protected void doStop(ServiceStopper stopper) throws Exception {
164164
super.doStop(stopper);
165165
}
166166
}
167-
}
167+
}

activemq-broker/pom.xml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,9 @@
186186
<reuseForks>false</reuseForks>
187187
<argLine>${surefire.argLine}</argLine>
188188
<runOrder>alphabetical</runOrder>
189-
<systemProperties>
190-
<property>
191-
<name>org.apache.activemq.default.directory.prefix</name>
192-
<value>target/</value>
193-
</property>
194-
</systemProperties>
189+
<systemPropertyVariables>
190+
<org.apache.activemq.default.directory.prefix>target</org.apache.activemq.default.directory.prefix>
191+
</systemPropertyVariables>
195192
<includes>
196193
<include>**/*Test.*</include>
197194
</includes>

activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2712,15 +2712,23 @@ public void startNetworkConnector(final NetworkConnector connector,
27122712
@Override
27132713
public void run() {
27142714
try {
2715-
LOG.info("Async start of {}", connector);
2716-
connector.start();
2715+
if(connector.isAutoStart()) {
2716+
LOG.info("Async start of {}", connector);
2717+
connector.start();
2718+
} else {
2719+
LOG.debug("Async start disabled for {}", connector);
2720+
}
27172721
} catch(Exception e) {
27182722
LOG.error("Async start of network connector: {} failed", connector, e);
27192723
}
27202724
}
27212725
});
27222726
} else {
2723-
connector.start();
2727+
if(connector.isAutoStart()) {
2728+
connector.start();
2729+
} else {
2730+
LOG.debug("Auto start disabled for {}", connector);
2731+
}
27242732
}
27252733
}
27262734

@@ -2735,7 +2743,9 @@ public TransportConnector startTransportConnector(TransportConnector connector)
27352743
connector = registerConnectorMBean(connector);
27362744
}
27372745
connector.getStatistics().setEnabled(enableStatistics);
2738-
connector.start();
2746+
if(connector.isAutoStart()) {
2747+
connector.start();
2748+
}
27392749
return connector;
27402750
}
27412751

activemq-broker/src/main/java/org/apache/activemq/broker/Connector.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ public interface Connector extends Service {
8080

8181
long getMaxConnectionExceededCount();
8282

83+
boolean isAutoStart();
84+
8385
/**
8486
* @return true if connector is started
8587
*/

activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnector.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public class TransportConnector implements Connector, BrokerServiceAware {
8080
private boolean allowLinkStealing = false;
8181
private boolean warnOnRemoteClose = false;
8282
private boolean displayStackTrace = false;
83+
private boolean autoStart = true;
8384

8485
LinkedList<String> peerBrokers = new LinkedList<String>();
8586
private AtomicBoolean started = new AtomicBoolean(false);
@@ -131,6 +132,7 @@ public ManagedTransportConnector asManagedConnector(ManagementContext context, O
131132
rc.setPublishedAddressPolicy(getPublishedAddressPolicy());
132133
rc.setAllowLinkStealing(allowLinkStealing);
133134
rc.setWarnOnRemoteClose(isWarnOnRemoteClose());
135+
rc.setAutoStart(isAutoStart());
134136
return rc;
135137
}
136138

@@ -696,4 +698,13 @@ public long getMaxConnectionExceededCount() {
696698
public boolean isStarted() {
697699
return started.get();
698700
}
701+
702+
public void setAutoStart(boolean autoStart) {
703+
this.autoStart = autoStart;
704+
}
705+
706+
@Override
707+
public boolean isAutoStart() {
708+
return autoStart;
709+
}
699710
}

activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ConnectorView.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@ public long getMaxConnectionExceededCount() {
142142
return this.connector.getMaxConnectionExceededCount();
143143
}
144144

145+
@Override
146+
public boolean isAutoStart() {
147+
return this.connector.isAutoStart();
148+
}
149+
145150
@Override
146151
public boolean isStarted() {
147152
return this.connector.isStarted();

activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ConnectorViewMBean.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ public interface ConnectorViewMBean extends Service {
9090
@MBeanInfo("Max connection exceeded count")
9191
long getMaxConnectionExceededCount();
9292

93+
/**
94+
* @return true if transport connector auto start is enabled
95+
*/
96+
@MBeanInfo("Auto-start enabled")
97+
boolean isAutoStart();
98+
9399
/**
94100
* @return true if transport connector is started
95101
*/

0 commit comments

Comments
 (0)