2

We are using Spring Batch and partitioning of jobs in a 10 server JBoss EAP 5.2 cluster. Because of a problem in JBoss messaging, we needed to use a topic for the reply message from the partitioned steps. All has been working fine until we see JBoss Messaging glitches (on the server that launches the job) and that drops it from the cluster. It recovers but the main partition does no``t pick up the messages sent from the partition steps. I see the messages in the topic in the JMX-Console but also see that the subscription and the messages are non-durable. Therefore I would like to make the communication for the partition step reply into a durable subscription. I can't seem to fine a document way to do this. This is my current configuration of the partitioned step and associated bean.

Inbound Gateway Configuration

<int:channel id="springbatch.slave.jms.request"/>
<int:channel id="springbatch.slave.jms.response" />

<int-jms:inbound-gateway 
    id="springbatch.master.inbound.gateway" 
    connection-factory="springbatch.listener.jmsConnectionFactory" 
    request-channel="springbatch.slave.jms.request" 
    request-destination="springbatch.partition.jms.requestsQueue" 
    reply-channel="springbatch.slave.jms.response" 
    concurrent-consumers="${springbatch.partition.concurrent.consumers}" 
    max-concurrent-consumers="${springbatch.partition.concurrent.maxconsumers}"
    max-messages-per-task="${springbatch.partition.concurrent.maxmessagespertask}"
    reply-time-to-live="${springbatch.partition.reply.time.to.live}"
    /> 

Outbound Gateway Configuration

<int:channel id="jms.requests">
    <int:dispatcher task-executor="springbatch.partitioned.jms.taskExecutor" />
</int:channel>
<int:channel id="jms.reply" />

<int-jms:outbound-gateway id="outbound-gateway"
    auto-startup="false" connection-factory="springbatch.jmsConnectionFactory"
    request-channel="jms.requests"
    request-destination="springbatch.partition.jms.requestsQueue"
    reply-channel="jms.reply"
    reply-destination="springbatch.partition.jms.repliesQueue"
    correlation-key="JMSCorrelationID">
    <int-jms:reply-listener />
</int-jms:outbound-gateway>

</code>
Gary Russell
  • 166,535
  • 14
  • 146
  • 179
Mike Rother
  • 591
  • 4
  • 16
  • What version of Spring Batch are you using? The recent versions don't require the return message and can poll the job repository instead if that's a better option for you. – Michael Minella Jan 08 '16 at 03:31
  • We are running Spring Batch 2.2.7. By recent versions, I assume you mean 3.x. What is the level of effort to move from 2.2.7 to 3.0? – Mike Rother Jan 10 '16 at 13:42
  • The upgrade effort from 2.2.x to 3.x should be minimal since the only major new functionality was to implement JSR-352. There wasn't much else going on outside that within the 3.x release. Off the top of my head, I know you need to upgrade the schema version...beyond that, I wouldn't expect anything earth shattering. – Michael Minella Jan 11 '16 at 15:24
  • I am in the process to upgrading spring batch (and spring core). Do you have an example configuration showing the polling of the repository instead of a reply message? – Mike Rother Jan 11 '16 at 20:54
  • I looked at the documentation for 3.0.6 and the samples jobs. I am not sure how you configure to use a different listener. Do you still use inbound and outbound gateways but don't configure a reply channel and specify a different listener than replyListener? – Mike Rother Jan 12 '16 at 12:26

1 Answers1

1

Further to Michael's comment; there is currently no way to configure a topic for the <reply-listener/> - it's rather unusual to use a topic in a request/reply scenario and we didn't anticipate that requirement.

Feel free to open a JIRA Issue against Spring Integration.

An alternative would be to wire in an outbound-channel-adapter for the requests and an inbound-channel-adapter for the replies. However, some special handling of the replyChannel header is needed when doing that - see the docs here for more information about that.

Gary Russell
  • 166,535
  • 14
  • 146
  • 179