Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
176 views
in Technique[技术] by (71.8m points)

mule - Blocking="false" is not working in JDBC Reconnection in 3.4.2

In JDBC Reconnection strategy implemented blocking as false.. so when we try to deploy the application, even though JDBC connection fails applicaion should be deployed.But Application is not getting deployed in server.

Following is the xml code

<jdbc-ee:connector name="FTPDatabase" dataSource-ref="MySQL_FTP_Data_Source"
        validateConnections="true" queryTimeout="-1" pollingFrequency="0"
        doc:name="Database">
        <reconnect blocking="false" frequency="10000" count="3"/>
    </jdbc-ee:connector>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

In my opinion this is not possible in a OOTB Mule application. The main reason being the manner in which Mule handles exceptions.

What you are facing is a System Exception.

System Exceptions

Mule invokes a System Exception Strategy when an exception is thrown at the system-level (i.e., when no message is involved, exceptions are handled by system exception strategies). For example, system exception strategies handle exceptions that occur:

during application start-up when a connection to an external system fails When a system exception strategy occurs, Mule sends an exception notification to registered listeners, logs the exception, and — if the exception was caused by a connection failure — executes the reconnection strategy. System Exception Strategies are not configurable in Mule

You can read more about Mule's error handling here

I guess the designers were of the opinion that if you have a DB connector, the DB will be accessible when the Mule application starts up, and in many ways this is a good feature instead of failing silently, it fails loud and fails fast :)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...