Skip to content

Conversation

@artembilan
Copy link
Member

JIRA: https://jira.spring.io/browse/INT-4519

  • Modify DynamicJmsTemplate to default for -1 if we get
    CachingConnectionFactory and it is with cacheConsumers, otherwise
    1 second
  • Polishing for some JMS XML parsers, in particular remove
    receiveTimeout population

Cherry-pick to 5.0.x

super.setReceiveTimeout(JmsDestinationAccessor.RECEIVE_TIMEOUT_NO_WAIT);
}
else {
super.setReceiveTimeout(1000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sonar will bark about a "magic" number; should be a constant.

----
====

Starting with version 5.1, a default value of the `receive-timeout` is `-1` (no wait) for the `org.springframework.jms.connection.CachingConnectionFactory` and `cacheConsumers`, otherwise it is 1 second.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conflicts with "cherry-pick" statement in commit comment.

@garyrussell
Copy link
Contributor

Suspicious travis test failure.

org.springframework.integration.jms.dsl.JmsTests > testJmsOutboundInboundFlow FAILED
java.lang.AssertionError at JmsTests.java:179

JIRA: https://jira.spring.io/browse/INT-4519

* Modify `DynamicJmsTemplate` to default for `-1` if we get
`CachingConnectionFactory` and it is with `cacheConsumers`, otherwise
1 second
* Polishing for some JMS XML parsers, in particular remove
`receiveTimeout` population

**Cherry-pick to 5.0.x**
@artembilan
Copy link
Member Author

Hm... Not sure what's going on...
Can it be an effect of the JmsTemplate.RECEIVE_TIMEOUT_NO_WAIT and CachingConnectionFactory with the cacheConsumers by default?

@garyrussell
Copy link
Contributor

garyrussell commented Aug 20, 2018

I think it's because the outbound flow uses the non-caching CF, so the vm:// could terminate before the container starts.

The outbound flow (and any template-based endpoints) should use the cachingConnectionFactory() anyway.

@garyrussell
Copy link
Contributor

So, not related to this PR, but a test bug anyway.

@garyrussell garyrussell merged commit 0545a7b into spring-projects:master Aug 20, 2018
garyrussell pushed a commit to garyrussell/spring-integration that referenced this pull request Aug 20, 2018
* INT-4519: Improve JMS inbound-c-a receiveTimeout

JIRA: https://jira.spring.io/browse/INT-4519

* Modify `DynamicJmsTemplate` to default for `-1` if we get
`CachingConnectionFactory` and it is with `cacheConsumers`, otherwise
1 second
* Polishing for some JMS XML parsers, in particular remove
`receiveTimeout` population

**Cherry-pick to 5.0.x**

* * Polishing according PR comments

* * Properly use a `CachingConnectionFactory` in `JmsTests`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants