[quartznet:4112] quartz .net as windows service IBM mq listener

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[quartznet:4112] quartz .net as windows service IBM mq listener

susahin80
Hi,

I wonder whether quartz .net windows service is suitable for MQ listening in a custom job.

I made some tests,

I created a custom job with attribute  [DisallowConcurrentExecution]   so that only one instance runs.

[DisallowConcurrentExecution]
public class MqJob : IJob

In the execute method, the job listens an IBM MQ, and if some message comes, it immediately process the message.

But  I had big problem when I wanted to stop Quartz Server window service, since the mq job is always running (listening) and preventing the service being stopped.

Any advise on this subject?

--
You received this message because you are subscribed to the Google Groups "Quartz.NET" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/quartznet.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [quartznet:4113] quartz .net as windows service IBM mq listener

Mark Gillen
Hi Susahin80,


In the Scheduler Shutdown method you can pass "false" for the value of the "waitForJobsToComplete" param.

This will terminate the scheduler and not wait on your perpetual job.

You could also implement some kind of cancellation token or poison pill to force the job to shutdown.

Best Regards,
Mark Gillen

----- susahin80 <[hidden email]> wrote:

> Hi,
>
> I wonder whether quartz .net windows service is suitable for MQ listening
> in a custom job.
>
> I made some tests,
>
> I created a custom job with attribute  [DisallowConcurrentExecution]   so
> that only one instance runs.
>
> [DisallowConcurrentExecution]
> public class MqJob : IJob
>
> In the execute method, the job listens an IBM MQ, and if some message
> comes, it immediately process the message.
>
> But  I had big problem when I wanted to stop Quartz Server window service,
> since the mq job is always running (listening) and preventing the service
> being stopped.
>
> Any advise on this subject?
>
> --
> You received this message because you are subscribed to the Google Groups "Quartz.NET" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> To post to this group, send email to [hidden email].
> Visit this group at https://groups.google.com/group/quartznet.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Quartz.NET" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/quartznet.
For more options, visit https://groups.google.com/d/optout.