# Use a JMS listener as an intermediate task in a process

**URL:** <https://forum.flowable.org/t/use-a-jms-listener-as-an-intermediate-task-in-a-process/841>\
**Category:** Flowable Engine\
**Created:** [August 11, 2017, 9:50am UTC](https://forum.flowable.org/t/use-a-jms-listener-as-an-intermediate-task-in-a-process/841 "2017-08-11T09:50:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jiji1james](https://avatars.discourse-cdn.com/v4/letter/j/ba8739/32.png) [@jiji1james](https://forum.flowable.org/u/jiji1james)\
**Post date:** [August 11, 2017, 9:50am UTC](https://forum.flowable.org/t/use-a-jms-listener-as-an-intermediate-task-in-a-process/841/1 "2017-08-11T09:50:43Z")

</div>

We are trying to design a process where the first task invokes a REST API to initiate a long running backend job. This backend job publishes on a topic once its completed. How can i have the second task to be one that waits for this message to be published on the topic.

---

<div class="post-metadata">

**Author:** ![vinayksharma](https://avatars.discourse-cdn.com/v4/letter/v/bc8723/32.png) [@vinayksharma](https://forum.flowable.org/u/vinayksharma)\
**Post date:** [August 11, 2017, 6:31pm UTC](https://forum.flowable.org/t/use-a-jms-listener-as-an-intermediate-task-in-a-process/841/2 "2017-08-11T18:31:06Z")

</div>

Hi

I too had a similar need, where I needed to wait for DB update before moving to the next step. I used an “Intermediate timer catching event” for this purpose. It polled DB after a specific time interval, to see if the DB had the specific value, to move to the next step.

---

<div class="post-metadata">

**Author:** ![tijs](https://avatars.discourse-cdn.com/v4/letter/t/bc79bd/32.png) [@tijs](https://forum.flowable.org/u/tijs)\
**Post date:** [August 15, 2017, 7:16am UTC](https://forum.flowable.org/t/use-a-jms-listener-as-an-intermediate-task-in-a-process/841/3 "2017-08-15T07:16:18Z")

</div>

Hi,

Another possible solution could be to use a receive task and signal the process instance when the message has been read from the topic.

Best regards,

Tijs

---

<div class="post-metadata">

**Author:** ![mchathuranga4](https://avatars.discourse-cdn.com/v4/letter/m/9de0a6/32.png) [@mchathuranga4](https://forum.flowable.org/u/mchathuranga4)\
**Post date:** [July 8, 2020, 9:34am UTC](https://forum.flowable.org/t/use-a-jms-listener-as-an-intermediate-task-in-a-process/841/4 "2020-07-08T09:34:17Z")

</div>

Was this solved? Can anyone provide the Implementation wise solution here?
