1

We currently have a on premises cluster environment where we currently have 2 node clustered. We are using Mule 3.8.2 runtime. We are aware that quartz is not a cluster aware and after a google search, we found if we deploy quartz in a cluster it will trigger from both the nodes simultaneously. So for that we need to configure JDBC Job Store in quartz

To test it I have deployed the following Mule flow in the cluster without any job store:

<quartz:connector name="QuartzConn" validateConnections="true" doc:name="Quartz">
    <receiver-threading-profile maxThreadsActive="1"/>
</quartz:connector> 
 
<flow name="TestFlow" processingStrategy="synchronous">
    <quartz:inbound-endpoint name="connectorname" jobName="testjob" repeatInterval="10000"
                responseTimeout="10000" doc:name="QuartzConn" connector-ref="QuartzConn">
        <quartz:event-generator-job>
            <quartz:payload>This is a test payload</quartz:payload>
        </quartz:event-generator-job>
    </quartz:inbound-endpoint>
    <logger message="Server Name:- #[server.ip+'\n'] This is a message #[function:now]" level="INFO" doc:name="Logger"/>
    <file:outbound-endpoint path="E:\test" outputPattern="#[server.dateTime.format('YYYY-MM-dd-hh-mm-ss.sss')].txt" responseTimeout="10000" doc:name="File"/>
</flow>

But to my surprise I found, only one node is currently executing the quartz and the file was written in target folder with timestamp, while other node was silently waiting and was doing nothing!!!

Node1 was writing all the file :

enter image description here

While Node2 was silently waiting and observing:

enter image description here

(images are attached)

So, to test further, I shutdown Node1 and I found Node2 started picking the task and was writing the file.

Please node this is a simple quartz application without any jdbc job store configured. So, how can I explain this action? both of the nodes are configured with mmc and performing well.

If somebody could explain the quartz in cluster in more details, it would be helpful.

Thanks

Community
  • 1
  • 1
Sri Arun
  • 133
  • 11
  • Both Nodes are active in your case? or Node 1 active and Node 2 is silent?. Only on disaster of Node 1, Node 2 will be active right? – star Jan 26 '17 at 19:41
  • As per Mule docs here :- https://docs.mulesoft.com/mule-user-guide/v/3.8/mule-high-availability-ha-clusters Mule uses an active-active model to cluster Mule runtimes, rather than an active-passive model. In an active-active model, no one node in the cluster acts as the primary node; all nodes in the cluster support the application. So, to support Quartz in cluster, it is recommenced to use JDBCJobStore, which will lock the Quartz instance as Quartz in not cluster aware ... – Sri Arun Jan 28 '17 at 18:44
  • I was referring the following thread :- https://forums.mulesoft.com/questions/40531/quartz-connector-in-with-clustering.html and http://www.quartz-scheduler.org/documentation/quartz-2.x/configuration/ConfigJDBCJobStoreClustering But now to my surprise, I found it's working without JDBCJobStore – Sri Arun Jan 28 '17 at 18:44
  • Thats right.You can implement in either way how your cluster environment looks like depends on decision of Architects by looking at your requirements . All i want to ask is your cluster environment implementation mode is 'active-active' or 'active-passive mode'?. Please confirm. – star Jan 28 '17 at 21:51
  • I created the cluster using mmc and deployed using mmc. Is there any way to find out whether the mode is 'active-active' or 'active-passive mode'? – Sri Arun Jan 29 '17 at 20:46

2 Answers2

0

"I don't want to use poll, as I need to know the reason of it's working"...well that is your choice but Mule documentation clearly states that Poll scope is preferred in clustered environment.

Whereas in non-clustered environment, you can use Quartz with JDBC jobstore to achieve same functionality, bit complex though. Explained here and here

Nitin Gaur
  • 922
  • 1
  • 14
  • 21
-1

If you want to just try out its fine but with Mule cluster you don't need to add Quartz, instead use Poll scope. Probably presence of Mule cluster has enabled quartz clustering without JDBC job store. However, in non-clustered Mule setup (we have 2 non-clustered nodes), Quartz cluster with JDBC job store is only option.

Mulesoft is playing smart. They have added Poll scope which is good but in typical Production environment with at least 2 nodes, you want only one node to poll. This is only possible if you buy Mule's cluster known as High Availablity but that is available in Platinum subscription only (not in Gold). So, indirectly Mulesoft forcing customer to buy or upgrade to Platinum subscription to fetch more money out of same product.

Nitin Gaur
  • 922
  • 1
  • 14
  • 21
  • This is not true.. Quartz is not cluster aware so presence of Mule cluster cannot enabled Quartz clustering .. And secondly I don't want to use poll, as I need to know the reason of it's working as Mule claim both the nodes are "active-active" .. so I need to know if something I am missing here or Mule has done something with quartz to make it cluster aware which I don't find in any document – Sri Arun Feb 01 '17 at 19:23
  • @KalyanKundu, When you run Mule in clustered environment, all non-distributed stores used with transports such as File, FTP, and JDBC – these stores are read by a single node at a time. By default quartz use in-memory jobstore and all clustered Mule instances share memory. This might explain your scenario. However, there is no reference of such in Mule documentation. I suggest to get it confirmed via Mule support. – Nitin Gaur Feb 02 '17 at 05:12