// Session is pre-acknowledge
session = (ClientSessionInternal)csf.createSession(user, password, false, true, true, true, 1);
if (forwardingAddress != null)
{
BindingQuery query = null;
try
{
query = session.bindingQuery(forwardingAddress);
}
catch (Throwable e)
{
log.warn("Error on querying binding. Retrying", e);
retry = true;
Thread.sleep(100);
continue;
}
if (forwardingAddress.startsWith(BridgeImpl.JMS_QUEUE_ADDRESS_PREFIX) || forwardingAddress.startsWith(BridgeImpl.JMS_TOPIC_ADDRESS_PREFIX))
{
if (!query.isExists())
{
retryCount ++;
if (serverLocator.getReconnectAttempts() > 0)
{
if (retryCount > serverLocator.getReconnectAttempts())
{
log.warn("Retried " + forwardingAddress + " up to the configured reconnectAttempts(" + serverLocator.getReconnectAttempts() + "). Giving up now. The bridge " + this.getName() + " will not be activated");
return false;
}
}
log.warn("Address " + forwardingAddress + " doesn't have any bindings yet, retry #(" + retryCount + ")");
Thread.sleep(serverLocator.getRetryInterval());
retry = true;
csf.close();
session.close();
continue;
}
}
else
{
if (!query.isExists())
{
log.info("Bridge " + this.getName() + " connected to fowardingAddress=" + this.getForwardingAddress() + ". " + getForwardingAddress() + " doesn't have any bindings what means messages will be ignored until a binding is created.");
}
}
}