문제

I`ve made a software using mule that logs what it is doing (rounting a WS) into a database but if the db is down it doenst go up and the log only says the connection is refused, after puting the db server up it works just fine, is there any option or way to configure my mule software so it can restart and work fine even if the db is down, since its optional not requered for the procedure?

code:

<jdbc:postgresql-data-source name="WSA" user="${database.user}" password="${database.pass}" url="${database.url}" transactionIsolation="UNSPECIFIED" doc:name="PostgreSQL Data Source"> </jdbc:postgresql-data-source>

<jdbc:connector name="jdbcConnector" dataSource-ref="WSA" validateConnections="false" queryTimeout="10" pollingFrequency="10000" doc:name="Database"> 
    <jdbc:query key="wsadb" value="insert into inbound_messages (payload, timestamp, agent, ip_from, endpoint, soap_operation) values ('', now(), #[groovy: return message.getInboundProperty('user-agent').toString()], #[groovy: return message.getInboundProperty('MULE_REMOTE_CLIENT_ADDRESS').toString()], #[groovy: return message.getInboundProperty('http.request').toString()], '');"></jdbc:query>  
</jdbc:connector>

<flow name="log-request" doc:name="log-request">
    <vm:inbound-endpoint path="log-request.in" doc:name="VM"></vm:inbound-endpoint>  
    <logger message="#[groovy: return message.getInboundProperty('user-agent').toString()], #[groovy: return message.getInboundProperty('MULE_REMOTE_CLIENT_ADDRESS').toString()], #[groovy: return message.getInboundProperty('http.request').toString()]" level="INFO" doc:name="Logger"></logger>  
    <jdbc:outbound-endpoint exchange-pattern="one-way" queryKey="wsadb" responseTimeout="10000" queryTimeout="10" connector-ref="jdbcConnector" doc:name="Persist raw message"></jdbc:outbound-endpoint>
</flow>
도움이 되었습니까?

해결책

You would need a reconnection strategy in your JDBC connector and set it to blocking="false": http://www.mulesoft.org/documentation/display/current/Configuring+Reconnection+Strategies

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top