[CONF] Apache ActiveMQ Encrypted passwords
Fintan Bolton edited the page: Encrypted passwords ... Where the password you want to encrypt is passed with the input argument, while the password argument is a secret used by the encryptor. In a similar fashion you can test-out your passwords like: Code Block $ bin/activemq decrypt --password activemq --input eeWjNyX6FY8Fjp3E+F6qTytV11bZItDp ... Decrypted text: mypassword Note: It is recommended that you use only alphanumeric characters for the password. Special characters, such as $/^, are not supported. The next step is to add the password to the appropriate configuration file, $ACTIVEMQ_HOME/conf/credentials-enc.properties by default. ... If you want to run the broker with this configuration, you need to do the following: Set environment variable: Code Block $ export ACTIVEMQ_ENCRYPTION_PASSWORD=activemq Start the broker: Code Block $ bin/activemq start xbean:conf/activemq-security.xml Unset the environment variable:
svn commit: r920020 - in /websites/production/activemq/content: cache/main.pageCache encrypted-passwords.html
Author: buildbot Date: Thu Aug 21 10:20:40 2014 New Revision: 920020 Log: Production update by buildbot for activemq Modified: websites/production/activemq/content/cache/main.pageCache websites/production/activemq/content/encrypted-passwords.html Modified: websites/production/activemq/content/cache/main.pageCache == Binary files - no diff available. Modified: websites/production/activemq/content/encrypted-passwords.html == --- websites/production/activemq/content/encrypted-passwords.html (original) +++ websites/production/activemq/content/encrypted-passwords.html Thu Aug 21 10:20:40 2014 @@ -81,39 +81,22 @@ tbody tr td valign=top width=100% -div class=wiki-content maincontentpAs of ActiveMQ 5.4.1 you can encrypt your passwords and safely store them in configuration files. To encrypt the password, you can use the newly added codeencrypt/code command like:/p - -div class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl +div class=wiki-content maincontentpAs of ActiveMQ 5.4.1 you can encrypt your passwords and safely store them in configuration files. To encrypt the password, you can use the newly added codeencrypt/code command like:/pdiv class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl script class=theme: Default; brush: java; gutter: false type=syntaxhighlighter![CDATA[$ bin/activemq encrypt --password activemq --input mypassword ... Encrypted text: eeWjNyX6FY8Fjp3E+F6qTytV11bZItDp]]/script -/div/div - -pWhere the password you want to encrypt is passed with the codeinput/code argument, while the codepassword/code argument is a secret used by the encryptor.br clear=none -In a similar fashion you can test-out your passwords like:/p - -div class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl +/div/divpWhere the password you want to encrypt is passed with the codeinput/code argument, while the codepassword/code argument is a secret used by the encryptor. In a similar fashion you can test-out your passwords like:/pdiv class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl script class=theme: Default; brush: java; gutter: false type=syntaxhighlighter![CDATA[$ bin/activemq decrypt --password activemq --input eeWjNyX6FY8Fjp3E+F6qTytV11bZItDp ... Decrypted text: mypassword]]/script -/div/div - -pThe next step is to add the password to the appropriate configuration file, code$ACTIVEMQ_HOME/conf/credentials-enc.properties/code by default./p - -div class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl +/div/divpstrongNote:/strong It is recommended that you use only alphanumeric characters for the password. Special characters, such as code$/^amp;/code, are not supported./ppThe next step is to add the password to the appropriate configuration file, code$ACTIVEMQ_HOME/conf/credentials-enc.properties/code by default./pdiv class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl script class=theme: Default; brush: java; gutter: false type=syntaxhighlighter![CDATA[activemq.username=system activemq.password=ENC(mYRkg+4Q4hua1kvpCCI2hg==) guest.password=ENC(Cf3Jf3tM+UrSOoaKU50od5CuBa8rxjoL) ... jdbc.password=ENC(eeWjNyX6FY8Fjp3E+F6qTytV11bZItDp) ]]/script -/div/div - -pNote that we used codeENC()/code to wrap our encrypted passwords. You can mix plain and encrypted passwords in your properties files, so encrypted ones must be wrapped this way./p - -pFinally, you need to instruct your property loader to encrypt variables when it loads properties to the memory. Instead of standard property loader we'll use the special one (see code\$ACTIVEMQ_HOME/conf/activemq-security.xml/code) to achieve this./p - -div class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl +/div/divpNote that we used codeENC()/code to wrap our encrypted passwords. You can mix plain and encrypted passwords in your properties files, so encrypted ones must be wrapped this way./ppFinally, you need to instruct your property loader to encrypt variables when it loads properties to the memory. Instead of standard property loader we'll use the special one (see code\$ACTIVEMQ_HOME/conf/activemq-security.xml/code) to achieve this./pdiv class=code panel pdl style=border-width: 1px;div class=codeContent panelContent pdl script class=theme: Default; brush: java; gutter: false type=syntaxhighlighter![CDATA[lt;bean id=quot;environmentVariablesConfigurationquot; class=quot;org.jasypt.encryption.pbe.config.EnvironmentStringPBEConfigquot;gt; lt;property name=quot;algorithmquot; value=quot;PBEWithMD5AndDESquot; /gt; lt;property name=quot;passwordEnvNamequot; value=quot;ACTIVEMQ_ENCRYPTION_PASSWORDquot; /gt; @@ -127,24 +110,12
[CONF] Apache ActiveMQ VM Transport Reference
Torsten Mielke edited the page: VM Transport Reference Comment: Made it explicit that vm://brokerName needs to match the brokerName of the embedded broker in case its not auto-created. ... vm://brokerName?transportOptions If you want to connect to an already instantiated, embedded broker (e.g. as in case the case of Apache ServiceMix), make sure the brokerName used in the vm://brokerName url matches the brokerName of the already running broker. Transport Options Option Name Default Value Description marshal false If true, forces each command sent over the transport to be marshalled and unmarshalled using a WireFormat wireFormat default The name of the WireFormat to use wireFormat.* All the properties with this prefix are used to configure the wireFormat create true If the broker should be created on demand if it does not already exist. waitForStart -1 If 0, indicates the timeout in milliseconds to wait for a broker to start. Only supported in ActiveMQ 5.2+ broker.* All the properties with this prefix are used to configure the broker. See Configuring Wire Formats for more information
Jenkins build became unstable: ActiveMQ-Java7 » ActiveMQ :: Web Demo #422
See https://builds.apache.org/job/ActiveMQ-Java7/org.apache.activemq$activemq-web-demo/422/
Jenkins build is still unstable: ActiveMQ-Java7 #422
See https://builds.apache.org/job/ActiveMQ-Java7/changes
Jenkins build is still unstable: ActiveMQ-Java7 » ActiveMQ :: Web #422
See https://builds.apache.org/job/ActiveMQ-Java7/org.apache.activemq$activemq-web/422/
Jenkins build is still unstable: ActiveMQ-Java7 » ActiveMQ :: Unit Tests #422
See https://builds.apache.org/job/ActiveMQ-Java7/org.apache.activemq$activemq-unit-tests/changes
Jenkins build is still unstable: ActiveMQ-Java7 » ActiveMQ :: Runtime Configuration #422
See https://builds.apache.org/job/ActiveMQ-Java7/org.apache.activemq$activemq-runtime-config/422/
Jenkins build is still unstable: ActiveMQ-Java7 » ActiveMQ :: HTTP Protocol Support #422
See https://builds.apache.org/job/ActiveMQ-Java7/org.apache.activemq$activemq-http/422/
svn commit: r920035 - in /websites/production/activemq/content: cache/main.pageCache vm-transport-reference.html
Author: buildbot Date: Thu Aug 21 15:22:57 2014 New Revision: 920035 Log: Production update by buildbot for activemq Modified: websites/production/activemq/content/cache/main.pageCache websites/production/activemq/content/vm-transport-reference.html Modified: websites/production/activemq/content/cache/main.pageCache == Binary files - no diff available. Modified: websites/production/activemq/content/vm-transport-reference.html == --- websites/production/activemq/content/vm-transport-reference.html (original) +++ websites/production/activemq/content/vm-transport-reference.html Thu Aug 21 15:22:57 2014 @@ -81,41 +81,15 @@ tbody tr td valign=top width=100% -div class=wiki-content maincontenth3 id=VMTransportReference-TheVMTransportThe VM Transport/h3 - -pThe VM transport allows clients to connect to each other inside the VM without the overhead of the network communication. The connection used is not a socket connection but use direct method invocations which enables a high performance embedded messaging system./p - -pThe first client to use the VM connection will boot an embedded broker. Subsequent connections will attach that the same broker. Once all VM connections to the broker have been closed, the embedded broker will automatically shutdown./p - -h4 id=VMTransportReference-SimpleBrokerConfigurationSyntaxSimple Broker Configuration Syntax/h4 - -pThis is the normal syntax for a VM connection. It's simple, but provides only a limited amount of configuration of the embedded broker./p - -pstrongvm://brokerName?transportOptions/strong/p - -h5 id=VMTransportReference-TransportOptionsTransport Options/h5 - -div class=table-wraptable class=confluenceTabletbodytrth colspan=1 rowspan=1 class=confluenceThp Option Name /p/thth colspan=1 rowspan=1 class=confluenceThp Default Value /p/thth colspan=1 rowspan=1 class=confluenceThp Description /p/th/trtrtd colspan=1 rowspan=1 class=confluenceTdp marshal /p/tdtd colspan=1 rowspan=1 class=confluenceTdp false /p/tdtd colspan=1 rowspan=1 class=confluenceTdp If true, forces each command sent over the transport to be marshalled and unmarshalled using a WireFormat /p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdp wireFormat /p/tdtd colspan=1 rowspan=1 class=confluenceTdp default /p/tdtd colspan=1 rowspan=1 class=confluenceTdp The name of the WireFormat to use /p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdp wireFormat.* /p/tdtd colspan=1 rowspan=1 class=confluenceTdp#160;/ p/tdtd colspan=1 rowspan=1 class=confluenceTdp All the properties with this prefix are used to configure the wireFormat /p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdp create /p/tdtd colspan=1 rowspan=1 class=confluenceTdp true /p/tdtd colspan=1 rowspan=1 class=confluenceTdp If the broker should be created on demand if it does not already exist. /p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdp waitForStart /p/tdtd colspan=1 rowspan=1 class=confluenceTdp -1 /p/tdtd colspan=1 rowspan=1 class=confluenceTdp If gt; 0, indicates the timeout in milliseconds to wait for a broker to start. Only supported in ActiveMQ 5.2+ /p/td/trtrtd colspan=1 rowspan=1 class=confluenceTdp broker.* /p/tdtd colspan=1 rowspan=1 class=confluenceTdp#160;/p/tdtd colspan=1 rowspan=1 class=confluenceTdp All the properties with this prefix are used to con figure the broker. See a shape=rect href=configuring-wire-formats.htmlConfiguring Wire Formats/a for more information br clear=none class=atl-forced-newline /p/td/tr/tbody/table/div - - -h5 id=VMTransportReference-ExampleURIExample URI/h5 - -div class=preformatted panel style=border-width: 1px;div class=preformattedContent panelContent +div class=wiki-content maincontenth3 id=VMTransportReference-TheVMTransportThe VM Transport/h3pThe VM transport allows clients to connect to each other inside the VM without the overhead of the network communication. The connection used is not a socket connection but use direct method invocations which enables a high performance embedded messaging system./ppThe first client to use the VM connection will boot an embedded broker. Subsequent connections will attach that the same broker. Once all VM connections to the broker have been closed, the embedded broker will automatically shutdown./ph4 id=VMTransportReference-SimpleBrokerConfigurationSyntaxSimple Broker Configuration Syntax/h4pThis is the normal syntax for a VM connection. It's simple, but provides only a limited amount of configuration of the embedded broker./ppstrongvm://brokerName?transportOptions/strong/ppIf you want to connect to an already instantiated, embedded broker (e.g. as in cas e the case of Apache ServiceMix), make sure the brokerName used in the strongvm://brokerName/strong url matches the brokerName of the already running
buildbot failure in ASF Buildbot on activemq-site-production
The Buildbot has detected a new failure on builder activemq-site-production while building ASF Buildbot. Full details are available at: http://ci.apache.org/builders/activemq-site-production/builds/2914 Buildbot URL: http://ci.apache.org/ Buildslave for this Build: bb-cms-slave Build Reason: The Nightly scheduler named 'activemq-site-production' triggered this build Build Source Stamp: [branch activemq/activemq-website] HEAD Blamelist: BUILD FAILED: failed compile sincerely, -The Buildbot
[2/2] git commit: https://issues.apache.org/jira/browse/AMQCPP-551
https://issues.apache.org/jira/browse/AMQCPP-551 Ensure that the correct number of bytes are read and written to the stream for char type. Project: http://git-wip-us.apache.org/repos/asf/activemq-cpp/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-cpp/commit/35c570ba Tree: http://git-wip-us.apache.org/repos/asf/activemq-cpp/tree/35c570ba Diff: http://git-wip-us.apache.org/repos/asf/activemq-cpp/diff/35c570ba Branch: refs/heads/trunk Commit: 35c570ba75afa94fa5d3f9ad9068636766d361a9 Parents: a965f2b Author: Timothy Bish tabish...@gmail.com Authored: Thu Aug 21 12:56:00 2014 -0400 Committer: Timothy Bish tabish...@gmail.com Committed: Thu Aug 21 12:56:36 2014 -0400 -- .../marshal/PrimitiveTypesMarshaller.cpp| 373 +-- .../activemq/test/MapMessageTest.cpp| 126 +-- .../activemq/test/MapMessageTest.h | 2 + .../test/openwire/OpenwireMapMessageTest.h | 2 + 4 files changed, 276 insertions(+), 227 deletions(-) -- http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/35c570ba/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/PrimitiveTypesMarshaller.cpp -- diff --git a/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/PrimitiveTypesMarshaller.cpp b/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/PrimitiveTypesMarshaller.cpp index 5105831..58d94d1 100644 --- a/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/PrimitiveTypesMarshaller.cpp +++ b/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/PrimitiveTypesMarshaller.cpp @@ -39,159 +39,157 @@ using namespace decaf::lang; using namespace decaf::util; /// -void PrimitiveTypesMarshaller::marshal( const PrimitiveMap* map, std::vectorunsigned char buffer ) { +void PrimitiveTypesMarshaller::marshal(const PrimitiveMap* map, std::vectorunsigned char buffer) { try { ByteArrayOutputStream bytesOut; -DataOutputStream dataOut( bytesOut ); +DataOutputStream dataOut(bytesOut); -if( map == NULL ) { -dataOut.writeInt( -1 ); +if (map == NULL) { +dataOut.writeInt(-1); } else { -PrimitiveTypesMarshaller::marshalPrimitiveMap( dataOut, *map ); +PrimitiveTypesMarshaller::marshalPrimitiveMap(dataOut, *map); } -if( bytesOut.size() 0 ) { +if (bytesOut.size() 0) { std::pairunsigned char*, int array = bytesOut.toByteArray(); -buffer.insert( buffer.begin(), array.first, array.first + array.second ); -delete [] array.first; +buffer.insert(buffer.begin(), array.first, array.first + array.second); +delete[] array.first; } } -AMQ_CATCH_RETHROW( decaf::lang::Exception ) -AMQ_CATCHALL_THROW( decaf::lang::Exception ) +AMQ_CATCH_RETHROW(decaf::lang::Exception) +AMQ_CATCHALL_THROW(decaf::lang::Exception) } /// -void PrimitiveTypesMarshaller::unmarshal( PrimitiveMap* map, const std::vectorunsigned char buffer ) { +void PrimitiveTypesMarshaller::unmarshal(PrimitiveMap* map, const std::vectorunsigned char buffer) { try { -if( map == NULL || buffer.empty() ) { +if (map == NULL || buffer.empty()) { return; } // Clear old data map-clear(); -ByteArrayInputStream bytesIn( buffer ); -DataInputStream dataIn( bytesIn ); -PrimitiveTypesMarshaller::unmarshalPrimitiveMap( dataIn, *map ); +ByteArrayInputStream bytesIn(buffer); +DataInputStream dataIn(bytesIn); +PrimitiveTypesMarshaller::unmarshalPrimitiveMap(dataIn, *map); } -AMQ_CATCH_RETHROW( decaf::lang::Exception ) -AMQ_CATCHALL_THROW( decaf::lang::Exception ) +AMQ_CATCH_RETHROW(decaf::lang::Exception) +AMQ_CATCHALL_THROW(decaf::lang::Exception) } /// -void PrimitiveTypesMarshaller::marshal( const PrimitiveList* list, std::vectorunsigned char buffer ) { +void PrimitiveTypesMarshaller::marshal(const PrimitiveList* list, std::vectorunsigned char buffer) { try { ByteArrayOutputStream bytesOut; -DataOutputStream dataOut( bytesOut ); +DataOutputStream dataOut(bytesOut); -if( list == NULL ) { -dataOut.writeInt( -1 ); +if (list == NULL) { +dataOut.writeInt(-1); } else { -PrimitiveTypesMarshaller::marshalPrimitiveList( dataOut, *list ); +PrimitiveTypesMarshaller::marshalPrimitiveList(dataOut, *list); } -
buildbot success in ASF Buildbot on activemq-site-production
The Buildbot has detected a restored build on builder activemq-site-production while building ASF Buildbot. Full details are available at: http://ci.apache.org/builders/activemq-site-production/builds/2916 Buildbot URL: http://ci.apache.org/ Buildslave for this Build: bb-cms-slave Build Reason: The Nightly scheduler named 'activemq-site-production' triggered this build Build Source Stamp: [branch activemq/activemq-website] HEAD Blamelist: Build succeeded! sincerely, -The Buildbot
svn commit: r1619590 - in /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src: main/csharp/MessageConsumer.cs main/csharp/Threads/CompositeTaskRunner.cs test/csharp/AMQRedeliveryPolicyTest.cs
Author: tabish Date: Thu Aug 21 21:11:49 2014 New Revision: 1619590 URL: http://svn.apache.org/r1619590 Log: https://issues.apache.org/jira/browse/AMQNET-489 Merge in fixes from AMQ-5146 to honor the redelivery policy on messages dispatched from the Broker. Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Threads/CompositeTaskRunner.cs activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/AMQRedeliveryPolicyTest.cs Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs?rev=1619590r1=1619589r2=1619590view=diff == --- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs (original) +++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs Thu Aug 21 21:11:49 2014 @@ -39,6 +39,8 @@ namespace Apache.NMS.ActiveMQ /// /summary public class MessageConsumer : IMessageConsumer, IDispatcher { +private const int NO_MAXIMUM_REDELIVERIES = -1; + private readonly MessageTransformation messageTransformation; private readonly MessageDispatchChannel unconsumedMessages; private readonly LinkedListMessageDispatch dispatchedMessages = new LinkedListMessageDispatch(); @@ -789,7 +791,15 @@ namespace Apache.NMS.ActiveMQ { if(listener != null this.unconsumedMessages.Running) { - dispatchMessage = true; +if (RedeliveryExceeded(dispatch)) +{ +PosionAck(dispatch, dispatch to + ConsumerId + exceeds redelivery policy limit: + redeliveryPolicy.MaximumRedeliveries); +return; +} +else +{ + dispatchMessage = true; +} } else { @@ -1014,6 +1024,11 @@ namespace Apache.NMS.ActiveMQ } } } +else if (RedeliveryExceeded(dispatch)) +{ +Tracer.DebugFormat([{0}] received with excessive redelivered: {1}, ConsumerId, dispatch); +PosionAck(dispatch, dispatch to + ConsumerId + exceeds redelivery policy limit: + redeliveryPolicy.MaximumRedeliveries); +} else { return dispatch; @@ -1231,7 +1246,7 @@ namespace Apache.NMS.ActiveMQ } // evaluate both expired and normal msgs as otherwise consumer may get stalled - if((0.5 * this.info.PrefetchSize) = (this.deliveredCounter + this.ackCounter - this.additionalWindowSize)) + if ((0.5 * this.info.PrefetchSize) = (this.deliveredCounter + this.ackCounter - this.additionalWindowSize)) { this.session.SendAck(pendingAck); this.pendingAck = null; @@ -1250,6 +1265,18 @@ namespace Apache.NMS.ActiveMQ this.session.Connection.SyncRequest(ack); } +private void PosionAck(MessageDispatch dispatch, string cause) +{ +BrokerError poisonCause = new BrokerError(); +poisonCause.ExceptionClass = javax.jms.JMSException; +poisonCause.Message = cause; + +MessageAck posionAck = new MessageAck(dispatch, (byte) AckType.PoisonAck, 1); +posionAck.FirstMessageId = dispatch.Message.MessageId; +posionAck.PoisonCause = poisonCause; +this.session.Connection.SyncRequest(posionAck); +} + private void RegisterSync() { // Don't acknowledge now, but we may need to let the broker know the @@ -1387,14 +1414,19 @@ namespace Apache.NMS.ActiveMQ this.info.ConsumerId, this.dispatchedMessages.Count, this.redeliveryPolicy.MaximumRedeliveries); } +BrokerError
svn commit: r1619593 - /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs
Author: tabish Date: Thu Aug 21 21:18:29 2014 New Revision: 1619593 URL: http://svn.apache.org/r1619593 Log: https://issues.apache.org/jira/browse/AMQNET-489 Merge in fixes from AMQ-5146 to honor the redelivery policy on messages dispatched from the Broker. Removed some debug logging. Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs?rev=1619593r1=1619592r2=1619593view=diff == --- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs (original) +++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs Thu Aug 21 21:18:29 2014 @@ -1781,20 +1781,11 @@ namespace Apache.NMS.ActiveMQ { ActiveMQMessage amqMessage = dispatch.Message as ActiveMQMessage; -Tracer.Debug(Checking if Redelivery count is exceeded.); -Tracer.DebugFormat(Current policy = {0}, RedeliveryPolicy.MaximumRedeliveries); -Tracer.DebugFormat(Message Redelivery Count = {0}, dispatch.RedeliveryCounter); -Tracer.DebugFormat(Is Transacted? {0}, session.IsTransacted); -Tracer.DebugFormat(Is Message from redelivery plugin? {0}, amqMessage.Properties.Contains(redeliveryDelay)); - -bool result = session.IsTransacted redeliveryPolicy != null +return session.IsTransacted redeliveryPolicy != null redeliveryPolicy.MaximumRedeliveries != NO_MAXIMUM_REDELIVERIES dispatch.RedeliveryCounter redeliveryPolicy.MaximumRedeliveries // redeliveryCounter x expected after resend via brokerRedeliveryPlugin !amqMessage.Properties.Contains(redeliveryDelay); - -Tracer.DebugFormat(Exceeded Redelivery Max? {0}, result); -return result; } catch (Exception ignored) {
svn commit: r1619595 - in /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x: ./ src/main/csharp/MessageConsumer.cs src/main/csharp/Threads/CompositeTaskRunner.cs src/test/csharp/AMQRedelive
Author: tabish Date: Thu Aug 21 21:20:25 2014 New Revision: 1619595 URL: http://svn.apache.org/r1619595 Log: https://issues.apache.org/jira/browse/AMQNET-489 Merge in fixes from AMQ-5146 to honor the redelivery policy on messages dispatched from the Broker. Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/ (props changed) activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/main/csharp/MessageConsumer.cs activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/main/csharp/Threads/CompositeTaskRunner.cs activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/test/csharp/AMQRedeliveryPolicyTest.cs Propchange: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/ -- Merged /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk:r1619590-1619593 Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/main/csharp/MessageConsumer.cs URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/main/csharp/MessageConsumer.cs?rev=1619595r1=1619594r2=1619595view=diff == --- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/main/csharp/MessageConsumer.cs (original) +++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/main/csharp/MessageConsumer.cs Thu Aug 21 21:20:25 2014 @@ -39,6 +39,8 @@ namespace Apache.NMS.ActiveMQ /// /summary public class MessageConsumer : IMessageConsumer, IDispatcher { +private const int NO_MAXIMUM_REDELIVERIES = -1; + private readonly MessageTransformation messageTransformation; private readonly MessageDispatchChannel unconsumedMessages; private readonly LinkedListMessageDispatch dispatchedMessages = new LinkedListMessageDispatch(); @@ -789,7 +791,15 @@ namespace Apache.NMS.ActiveMQ { if(listener != null this.unconsumedMessages.Running) { - dispatchMessage = true; +if (RedeliveryExceeded(dispatch)) +{ +PosionAck(dispatch, dispatch to + ConsumerId + exceeds redelivery policy limit: + redeliveryPolicy.MaximumRedeliveries); +return; +} +else +{ + dispatchMessage = true; +} } else { @@ -1014,6 +1024,11 @@ namespace Apache.NMS.ActiveMQ } } } +else if (RedeliveryExceeded(dispatch)) +{ +Tracer.DebugFormat([{0}] received with excessive redelivered: {1}, ConsumerId, dispatch); +PosionAck(dispatch, dispatch to + ConsumerId + exceeds redelivery policy limit: + redeliveryPolicy.MaximumRedeliveries); +} else { return dispatch; @@ -1231,7 +1246,7 @@ namespace Apache.NMS.ActiveMQ } // evaluate both expired and normal msgs as otherwise consumer may get stalled - if((0.5 * this.info.PrefetchSize) = (this.deliveredCounter + this.ackCounter - this.additionalWindowSize)) + if ((0.5 * this.info.PrefetchSize) = (this.deliveredCounter + this.ackCounter - this.additionalWindowSize)) { this.session.SendAck(pendingAck); this.pendingAck = null; @@ -1250,6 +1265,18 @@ namespace Apache.NMS.ActiveMQ this.session.Connection.SyncRequest(ack); } +private void PosionAck(MessageDispatch dispatch, string cause) +{ +BrokerError poisonCause = new BrokerError(); +poisonCause.ExceptionClass = javax.jms.JMSException; +poisonCause.Message = cause; + +MessageAck posionAck = new MessageAck(dispatch, (byte) AckType.PoisonAck, 1); +posionAck.FirstMessageId = dispatch.Message.MessageId; +posionAck.PoisonCause = poisonCause; +this.session.Connection.SyncRequest(posionAck); +} + private void RegisterSync()
git commit: Fix the inheritance hierarchy of these tests.
Repository: activemq-cpp Updated Branches: refs/heads/trunk 35c570ba7 - 2f3c592ff Fix the inheritance hierarchy of these tests. Project: http://git-wip-us.apache.org/repos/asf/activemq-cpp/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-cpp/commit/2f3c592f Tree: http://git-wip-us.apache.org/repos/asf/activemq-cpp/tree/2f3c592f Diff: http://git-wip-us.apache.org/repos/asf/activemq-cpp/diff/2f3c592f Branch: refs/heads/trunk Commit: 2f3c592ff221e94ff088324b1cfcc1787f6a55b5 Parents: 35c570b Author: Timothy Bish tabish...@gmail.com Authored: Thu Aug 21 18:47:35 2014 -0400 Committer: Timothy Bish tabish...@gmail.com Committed: Thu Aug 21 18:47:35 2014 -0400 -- .../test/openwire/OpenwireNonBlockingRedeliveryTest.h| 8 ++-- .../activemq/test/openwire/OpenwireOptimizedAckTest.h| 8 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/2f3c592f/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireNonBlockingRedeliveryTest.h -- diff --git a/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireNonBlockingRedeliveryTest.h b/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireNonBlockingRedeliveryTest.h index 542094c..725b0ee 100644 --- a/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireNonBlockingRedeliveryTest.h +++ b/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireNonBlockingRedeliveryTest.h @@ -18,13 +18,14 @@ #ifndef _ACTIVEMQ_TEST_OPENWIRE_OPENWIRENONBLOCKINGREDELIVERYTEST_H_ #define _ACTIVEMQ_TEST_OPENWIRE_OPENWIRENONBLOCKINGREDELIVERYTEST_H_ -#include activemq/test/MessagePriorityTest.h +#include activemq/test/CMSTestFixture.h +#include activemq/util/IntegrationCommon.h namespace activemq { namespace test { namespace openwire { -class OpenwireNonBlockingRedeliveryTest : public MessagePriorityTest { +class OpenwireNonBlockingRedeliveryTest : public CMSTestFixture { CPPUNIT_TEST_SUITE( OpenwireNonBlockingRedeliveryTest ); //CPPUNIT_TEST( testConsumerMessagesAreNotOrdered ); @@ -41,6 +42,9 @@ namespace openwire { OpenwireNonBlockingRedeliveryTest(); virtual ~OpenwireNonBlockingRedeliveryTest(); +virtual void setUp() {} +virtual void tearDown() {} + virtual std::string getBrokerURL() const; void testConsumerMessagesAreNotOrdered(); http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/2f3c592f/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireOptimizedAckTest.h -- diff --git a/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireOptimizedAckTest.h b/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireOptimizedAckTest.h index 8d39922..c7e9899 100644 --- a/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireOptimizedAckTest.h +++ b/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireOptimizedAckTest.h @@ -18,13 +18,14 @@ #ifndef _ACTIVEMQ_TEST_OPENWIRE_OPENWIREOPTIMIZEDACKTEST_H_ #define _ACTIVEMQ_TEST_OPENWIRE_OPENWIREOPTIMIZEDACKTEST_H_ -#include activemq/test/MessagePriorityTest.h +#include activemq/test/CMSTestFixture.h +#include activemq/util/IntegrationCommon.h namespace activemq { namespace test { namespace openwire { -class OpenwireOptimizedAckTest : public MessagePriorityTest { +class OpenwireOptimizedAckTest : public CMSTestFixture { CPPUNIT_TEST_SUITE( OpenwireOptimizedAckTest ); CPPUNIT_TEST( testOptimizedAckSettings ); @@ -38,6 +39,9 @@ namespace openwire { OpenwireOptimizedAckTest(); virtual ~OpenwireOptimizedAckTest(); +virtual void setUp() {} +virtual void tearDown() {} + virtual std::string getBrokerURL() const; void testOptimizedAckSettings();
Jenkins build is still unstable: ActiveMQ-Java8 » ActiveMQ :: LevelDB Store #87
See https://builds.apache.org/job/ActiveMQ-Java8/org.apache.activemq$activemq-leveldb-store/87/
Jenkins build is still unstable: ActiveMQ-Java8 » ActiveMQ :: Web #87
See https://builds.apache.org/job/ActiveMQ-Java8/org.apache.activemq$activemq-web/87/
Jenkins build is still unstable: ActiveMQ-Java8 » ActiveMQ :: Runtime Configuration #87
See https://builds.apache.org/job/ActiveMQ-Java8/org.apache.activemq$activemq-runtime-config/87/
Jenkins build is still unstable: ActiveMQ-Java8 #87
See https://builds.apache.org/job/ActiveMQ-Java8/87/
Jenkins build is still unstable: ActiveMQ-Java8 » ActiveMQ :: Unit Tests #87
See https://builds.apache.org/job/ActiveMQ-Java8/org.apache.activemq$activemq-unit-tests/87/