This topic describes the release notes of the SDK for Java. To ensure optimal performance and stability, we recommend that you download the latest version of the SDK.
We recommend that you upgrade the SDK for Java to 1.1.9 or later.
Add JAXB dependencies
If you use Java 9 or later, you must add JAXB dependencies to the pom.xml file.
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>
<!-- no more than 2.3.3-->
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.3</version>
</dependency>
Version 1.1.9.1
Release date
2021-12-24
Download the SDK.
Download the sample code.
New features
The SLF4J dependency is used instead of the Log4j dependency.
Installation and running
Download and decompress the aliyun-sdk-mns-samples-1.1.9.1.zip package.
Import a Maven project into Eclipse and select the aliyun-sdk-mns-samples folder.
In the home directory, create a file named .aliyun-mns.properties and specify the endpoint, AccessKey ID, and AccessKey secret in the file.
NoteIn Linux, the home directory is /home/YOURNAME/. In Windows, the home directory is C:\Users\YOURNAME.
mns.accountendpoint=http://<yourAccountId>.mns.cn-hangzhou.aliyuncs.com mns.accesskeyid=<yourAccessKeyId> mns.accesskeysecret=<yourAccessKeySecret>
Configurations of the pom.xml file
<dependency> <groupId>com.aliyun.mns</groupId> <artifactId>aliyun-sdk-mns</artifactId> <version>1.1.9.1</version> </dependency>
Version 1.1.9
Release date
2021-03-18
Download the SDK.
Download the sample code.
New features
The OpenService operation is provided.
The bug that causes the client to throw the
I/O reactor status: STOPPED
error due to network jitter in specific scenarios is fixed.
Installation and running
Download and decompress the aliyun-sdk-mns-samples-1.1.9.zip package.
Import a Maven project into Eclipse and select the aliyun-sdk-mns-samples folder.
In the home directory, create a file named .aliyun-mns.properties and specify the endpoint, AccessKey ID, and AccessKey secret in the file.
NoteIn Linux, the home directory is /home/YOURNAME/. In Windows, the home directory is C:\Users\YOURNAME.
mns.accountendpoint=http://<yourAccountId>.mns.cn-hangzhou.aliyuncs.com mns.accesskeyid=<yourAccessKeyId> mns.accesskeysecret=<yourAccessKeySecret>
Configurations of the pom.xml file
<dependency> <groupId>com.aliyun.mns</groupId> <artifactId>aliyun-sdk-mns</artifactId> <version>1.1.9</version> </dependency>
Version 1.1.8
Release date
2016-12-15
Download the SDK.
Download the sample code.
New features
The BatchSendMessage operation is supported for subscriptions to topics.
Installation and running
Download and decompress the aliyun-sdk-mns-samples-1.1.8.zip package.
Import a Maven project into Eclipse and select the aliyun-sdk-mns-samples folder.
In the home directory, create a file named .aliyun-mns.properties and specify the endpoint, AccessKey ID, and AccessKey secret in the file.
NoteIn Linux, the home directory is /home/YOURNAME/. In Windows, the home directory is C:\Users\YOURNAME.
mns.accountendpoint=http://<yourAccountId>.mns.cn-hangzhou.aliyuncs.com mns.accesskeyid=<yourAccessKeyId> mns.accesskeysecret=<yourAccessKeySecret>
Configurations of the pom.xml file
<dependency> <groupId>com.aliyun.mns</groupId> <artifactId>aliyun-sdk-mns</artifactId> <version>1.1.8</version> </dependency>
Version 1.1.7
Release date
2016-08-30
Download the SDK.
Download the sample code.
New features
The same Java object is returned if the getMNSClient() method is called multiple times.
Bugs are fixed.
The JSON format is supported for subscriptions to topics.
Installation and running
Download and decompress the aliyun-sdk-mns-samples-1.1.7.zip package.
Import a Maven project into Eclipse and select the aliyun-sdk-mns-samples folder.
In the home directory, create a file named .aliyun-mns.properties and specify the endpoint, AccessKey ID, and AccessKey secret in the file.
NoteIn Linux, the home directory is /home/YOURNAME/. In Windows, the home directory is C:\Users\YOURNAME.
mns.accountendpoint=http://<yourAccountId>.mns.cn-hangzhou.aliyuncs.com mns.accesskeyid=<yourAccessKeyId> mns.accesskeysecret=<yourAccessKeySecret>
Configurations of the pom.xml file
<dependency> <groupId>com.aliyun.mns</groupId> <artifactId>aliyun-sdk-mns</artifactId> <version>1.1.7</version> </dependency>
Version 1.1.5
Release date
2016-05-26
Download the SDK.
Download the sample code.
New features
The TransactionQueue class is supported.
The messages can be sent from one client to multiple clients.
The sample code that is used for performance testing of the SDK for Java is provided.
Installation and running
Download and decompress the aliyun-sdk-mns-samples-1.1.5.zip package.
Import a Maven project into Eclipse and select the aliyun-sdk-mns-samples folder.
In the home directory, create a file named .aliyun-mns.properties and specify the endpoint, AccessKey ID, and AccessKey secret in the file.
NoteIn Linux, the home directory is /home/YOURNAME/. In Windows, the home directory is C:\Users\YOURNAME.
mns.accountendpoint=http://<yourAccountId>.mns.cn-hangzhou.aliyuncs.com mns.accesskeyid=<yourAccessKeyId> mns.accesskeysecret=<yourAccessKeySecret>
Run the sample code in the following files: QueueSample.java, TopicSample.java, CloudPullTopicDemo.java, TransactionMessageDemo.java, and TransactionMessageDemo2.java. The CloudPullTopicDemo.java file is used to send messages from one client to multiple clients. The TransactionMessageDemo.java and TransactionMessageDemo2.java files are used to handle transactional messages. When you use the code in the TransactionMessageDemo2.java file, you must specify on-premises transactions and the failover logic.
Configurations of the pom.xml file
<dependency> <groupId>com.aliyun.mns</groupId> <artifactId>aliyun-sdk-mns</artifactId> <version>1.1.5</version> </dependency>
Version 1.1.4
Release date
2016-04-25
Download the SDK.
Download the sample code.
New features
MNS queues and email addresses can be specified as endpoints of subscriptions.
Topic messages can be filtered.
The timeout error of long polling requests is fixed. This error occurs if the number of long polling requests exceeds the maximum number of connections per route.
Installation and running
Download and decompress the aliyun-sdk-mns-samples-1.1.4.zip package.
Import a Maven project into Eclipse and select the aliyun-sdk-mns-samples folder.
In the home directory, create a file named .aliyun-mns.properties and specify the endpoint, AccessKey ID, and AccessKey secret in the file.
NoteIn Linux, the home directory is /home/YOURNAME/. In Windows, the home directory is C:\Users\YOURNAME.
mns.accountendpoint=http://<yourAccountId>.mns.cn-hangzhou.aliyuncs.com mns.accesskeyid=<yourAccessKeyId> mns.accesskeysecret=<yourAccessKeySecret>
Run the sample code in the QueueSample.java and TopicSample.java files.
Configurations of the pom.xml file
<dependency> <groupId>com.aliyun.mns</groupId> <artifactId>aliyun-sdk-mns</artifactId> <version>1.1.4</version> </dependency>
Version 1.1.3
Release date
2016-03-28
Download the SDK.
Download the sample code.
New features
The HTTPS protocol is supported.
The default values of the priority, dequeueCount, and delaySeconds parameters of the Message object are removed.
Installation and running
Download and decompress the aliyun-sdk-mns-samples-1.1.3.zip package.
Import a Maven project into Eclipse and select the aliyun-sdk-mns-samples folder.
In the home directory, create a file named .aliyun-mns.properties and specify the endpoint, AccessKey ID, and AccessKey secret in the file.
NoteIn Linux, the home directory is /home/YOURNAME/. In Windows, the home directory is C:\Users\YOURNAME.
mns.accountendpoint=http://<yourAccountId>.mns.cn-hangzhou.aliyuncs.com mns.accesskeyid=<yourAccessKeyId> mns.accesskeysecret=<yourAccessKeySecret>
Run the sample code in the QueueSample.java and TopicSample.java files.
Configurations of the pom.xml file
<dependency> <groupId>com.aliyun.mns</groupId> <artifactId>aliyun-sdk-mns</artifactId> <version>1.1.3</version> </dependency>
Version 1.1.2
Release date
2016-01-30
Download the SDK.
Download the sample code.
New features
The following error is fixed: If you call the popMessage operation without specifying the waitseconds parameter, the waitseconds parameter is set to the value of the QueueMeta parameter rather than 0.
Installation and running
Download and decompress the aliyun-sdk-mns-samples-1.1.2.zip package.
Import a Maven project into Eclipse and select the aliyun-sdk-mns-samples folder.
In the home directory, create a file named .aliyun-mns.properties and specify the endpoint, AccessKey ID, and AccessKey secret in the file.
NoteIn Linux, the home directory is /home/YOURNAME/. In Windows, the home directory is C:\Users\YOURNAME.
mns.accountendpoint=http://<yourAccountId>.mns.cn-hangzhou.aliyuncs.com mns.accesskeyid=<yourAccessKeyId> mns.accesskeysecret=<yourAccessKeySecret>
Run the sample code in the QueueSample.java and TopicSample.java files.
Configurations of the pom.xml file
<dependency> <groupId>com.aliyun.mns</groupId> <artifactId>aliyun-sdk-mns</artifactId> <version>1.1.2</version> </dependency>
Version 1.1.1
Release date
2016-01-19
Download the SDK.
Download the sample code.
New features
The following error is fixed: UTF-8 rather than the default character set is used to encode Chinese messages.
Installation and running
Download and decompress the aliyun-sdk-mns-samples-1.1.1.zip package.
Import a Maven project into Eclipse and select the aliyun-sdk-mns-samples folder.
In the home directory, create a file named .aliyun-mns.properties and specify the endpoint, AccessKey ID, and AccessKey secret in the file.
NoteIn Linux, the home directory is /home/YOURNAME/. In Windows, the home directory is C:\Users\YOURNAME.
mns.accountendpoint=http://<yourAccountId>.mns.cn-hangzhou.aliyuncs.com mns.accesskeyid=<yourAccessKeyId> mns.accesskeysecret=<yourAccessKeySecret>
Run the sample code in the QueueSample.java and TopicSample.java files.
Configurations of the pom.xml file
<dependency> <groupId>com.aliyun.mns</groupId> <artifactId>aliyun-sdk-mns</artifactId> <version>1.1.1</version> </dependency>
Version 1.1.0
Release date
2016-01-06
Download the SDK.
Download the sample code.
New features
The topic feature is supported.
Security Token Service (STS) tokens are supported.
The Base64 encoding can be disabled.
Installation and running
Download the decompress the aliyun-sdk-mns-samples-1.1.0.zip package.
Import a Maven project into Eclipse and select the aliyun-sdk-mns-samples folder.
In the home directory, create a file named .aliyun-mns.properties and specify the endpoint, AccessKey ID, and AccessKey secret in the file.
NoteIn Linux, the home directory is /home/YOURNAME/. In Windows, the home directory is C:\Users\YOURNAME.
mns.accountendpoint=http://<yourAccountId>.mns.cn-hangzhou.aliyuncs.com mns.accesskeyid=<yourAccessKeyId> mns.accesskeysecret=<yourAccessKeySecret>
Run the sample code in the QueueSample.java and TopicSample.java files.
Configurations of the pom.xml file
<dependency> <groupId>com.aliyun.mns</groupId> <artifactId>aliyun-sdk-mns</artifactId> <version>1.1.0</version> </dependency>
Version 1.0.5
Release date
2015-12-02
Download the SDK.
Download the sample code.
New features
The memory leak is fixed. This error occurred if multiple CloudAccount objects exist.
HttpAsyncClient 4.1 is supported.
Installation and running
Download and decompress the aliyun-sdk-mns-samples-1.0.5.zip package.
Import a Maven project into Eclipse and select the aliyun-sdk-mns-samples folder.
In the home directory, create a file named .aliyun-mns.properties and specify the endpoint, AccessKey ID, and AccessKey secret in the file.
NoteIn Linux, the home directory is /home/YOURNAME/. In Windows, the home directory is C:\Users\YOURNAME.
mns.accountendpoint=http://<yourAccountId>.mns.cn-hangzhou.aliyuncs.com mns.accesskeyid=<yourAccessKeyId> mns.accesskeysecret=<yourAccessKeySecret>
Run the sample code in the Sample.java file.
Configurations of the pom.xml file
<dependency> <groupId>com.aliyun.mns</groupId> <artifactId>aliyun-sdk-mns</artifactId> <version>1.0.5</version> </dependency>
Version 1.0.4
Release date
2015-11-05
Download the SDK.
Download the sample code.
New features
The thread hanging is fixed. This error occurred due to network exceptions.
Idle connections can be disabled and resident threads can be reclaimed.
Installation and running
Download and decompress the aliyun-sdk-mns-samples-1.0.4.zip package.
Import a Maven project into Eclipse and select the aliyun-sdk-mns-samples folder.
In the home directory, create a file named .aliyun-mns.properties and specify the endpoint, AccessKey ID, and AccessKey secret in the file.
NoteIn Linux, the home directory is /home/YOURNAME/. In Windows, the home directory is C:\Users\YOURNAME.
mns.accountendpoint=http://<yourAccountId>.mns.cn-hangzhou.aliyuncs.com mns.accesskeyid=<yourAccessKeyId> mns.accesskeysecret=<yourAccessKeySecret>
Run the sample code in the Sample.java file.
Configurations of the pom.xml file
<dependency> <groupId>com.aliyun.mns</groupId> <artifactId>aliyun-sdk-mns</artifactId> <version>1.0.4</version> </dependency>
Version 1.0.3
Release date
2015-06-09
Download the SDK.
Download the sample code.
New features
The SDK hanging is fixed. This error occurs if you disable a large amount of waiting connections.
Sample code is added.
The API version: "x-mns-version"="2015-06-06" is supported.
The BatchSendMessage, BatchReceiveMessage, BatchPeekMessage, and BatchDeleteMessage operations are supported.
Installation and running
Download the decompress the aliyun-sdk-mns-samples-1.0.3.zip package.
Import a Maven project into Eclipse and select the aliyun-sdk-mns-samples folder.
In the home directory, create a file named .aliyun-mns.properties and specify the endpoint, AccessKey ID, and AccessKey secret in the file.
NoteIn Linux, the home directory is /home/YOURNAME/. In Windows, the home directory is C:\Users\YOURNAME.
mns.accountendpoint=http://<yourAccountId>.mns.cn-hangzhou.aliyuncs.com mns.accesskeyid=<yourAccessKeyId> mns.accesskeysecret=<yourAccessKeySecret>
Run the sample code in the Sample.java file.
Configurations of the pom.xml file
<dependency> <groupId>com.aliyun.mns</groupId> <artifactId>aliyun-sdk-mns</artifactId> <version>1.0.3</version> </dependency>
Version 1.0.2
Release date
2015-03-03
Download the SDK.
New features
The logic of parsing messages in the XML format is optimized to improve performance.
Configurations of the pom.xml file
<dependency> <groupId>com.aliyun.mns</groupId> <artifactId>aliyun-sdk-mns</artifactId> <version>1.0.2</version> </dependency>
Version 1.0.1
Release date
2014-12-19
Download the SDK.
New features
A maximum of 50 threads for a thread pool are supported. The performance bottleneck is fixed. This bottleneck occurs due to large-scale concurrent workloads.
Configurations of the pom.xml file
<dependency> <groupId>com.aliyun.mns</groupId> <artifactId>aliyun-sdk-mns</artifactId> <version>1.0.1</version> </dependency>