Reputation: 7552
What are the likely causes when the @connect method of my connector fails to be hit in a cloud connector I'm working on? My project is constructed from the Maven cloud connector archetype.
The @source gets called fine and the update site is generated fine in Maven and imported into Mule Studio.
/**
* @param configFileLocation config File Location
*/
@Connect
public void connect(final String configFileLocation)
throws ConnectionException {
System.out.println("Connect called");
<connect code in here...>
}
@Source
public void inboundEndpoint(final String sessionID,
final SourceCallback callback) {
getSessionSourceCallbackMap().put(sessionID, callback);
}
Could it be to do with the fact that I don't need to have user and password params in the connect method? I suspect I will need to dig around in the generated update site code..
maybe this helps: after stepping through some code the debugger pauses on:
ConnectorInjectionAdapter connector = new ConnectorInjectionAdapter();
and in InboundEndpointMessageSource.java, a unhandled exception is caught
finally {
if (connection!= null) {
try {
castedModuleObject.releaseConnection(new FixConnectorConnectionManager.ConnectionKey(transformedConfigFileLocation), connection);
} catch (Exception _x) {
}
}
Upvotes: 0
Views: 192
Reputation: 7552
The solution was to have the method marked @ValidateConnection with a non true value (the default method stubb)
@ValidateConnection
public boolean isConnected() {
//code to say whether connected or not
}
Upvotes: 1
Reputation: 33413
Basic check: your class should be annotated with @Connector
not @Module
.
Try doing the following:
@ConnectionKey
to the configFileLocation
argument of the connect()
method,@ConnectionIdentifier
on getConfigFileLocation()
(add the getter if you don't have it)and see what happens.
Upvotes: 1