Now everything works!
Thank you Gary (and bsnyder too) !
This was the final configuration.
Client Side
----------
In java code I use ActiveMQConnectionFactory
(previously, I used "generic" JMS ConnectionFactory) in order
to call connectionFactory.setAlwaysSyncSend(true) method.
In jndi.properties file I specify in this way AMQ URL:
java.naming.provider.url = tcp://<my
host>:61616?wireFormat.maxInactivityDuration=0&jms.useAsyncSend=false
ServerSide
----------
In AMQ 5.3 xml conf file:
<destinationPolicy>
<policyMap>
<policyEntries>
<policyEntry queue="NAM_QUEUE_01" producerFlowControl="true"
advisoryWhenFull="true"
memoryLimit="20 kb">
<pendingQueuePolicy>
<vmQueueCursor/>
</pendingQueuePolicy>
</policyEntry>
</policyEntries>
</policyMap>
</destinationPolicy>
<systemUsage>
<systemUsage sendFailIfNoSpace="true">
<memoryUsage>
<memoryUsage limit="200 mb"/>
</memoryUsage>
<storeUsage>
<storeUsage limit="1 gb" name="foo"/>
</storeUsage>
<tempUsage>
<tempUsage limit="100 mb"/>
</tempUsage>
</systemUsage>
With setAlwaysSyncSend() method, client receives
ResourceAllocationException.
With <vmQueueCursor/> policy, exception is raised in a deterministic way
(in my tests always after 20 messages).
There is no reason to test 5.4 SNAPSHOT (5.3. is already good).
I try to redo this test using 5.1 release.
Ciao,
Moreno
Gary Tully wrote:
>
> so using sync send (alwaysSyncSend=true) on the connection factory, and
> Usage.sendFailIfNoSpace in your config is what you need here. This should
> work and should be deterministic. If this is not the case, can you open a
> jira issue and attach your test case and we can get to the bottom of this.
> When the queue memory limit is reached and the system memory limit is
> *not*
> reached (such that no spooling to disk occurs) (or if you use a
> vmPendingMessageCursor (so messages are always in memory)) the send
> operation will fail with a ResourceAllocaitonException which will be
> propagated back to the client, which will be blocked because of the sync
> send.
>
--
View this message in context:
http://old.nabble.com/How-to-%22activate%22-an-interceptor-tp26478807p26514557.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.