title: Spring integration outbound-channel-adapter and database persistence
body: <p>I am working on an application which publishes a message to a queue using an outbound-channel-adapter. There is a new requirement that an unique id generated during the message processing should be persisted to database after a successful publish on the queue, without waiting for any reply.</p>
  
  <p>Could someone please advise what should be the best approach for this.</p>
  
  <p>This is what I have in my existing application.</p>
  
  <pre><code>&lt;int:gateway id="writerGateway" service-interface="CustomService" default-request-channel="writerChannel"&gt;
  &lt;/int:gateway&gt;
  
  &lt;int-jms:outbound-channel-adapter channel="writerChannel" jms-template="jmsTemplate" destination-name="${queueName}" extract-payload="true"/&gt;
  
  &lt;int:channel id="writerChannel"&gt;
      &lt;int:interceptors&gt;
          &lt;int:wire-tap channel="writerLogger"/&gt;
      &lt;/int:interceptors&gt;
  &lt;/int:channel&gt;
  
  &lt;int:logging-channel-adapter id="writerLogger" logger-name="writerLogger" level="INFO" expression="'Sending ' + payload?.size() + ' events'"/&gt;
  </code></pre>
  
  <p>Any help will be much appreciated.</p>
  
  <p>Thanks,
  AK</p>