deal with not having tunnels a bit earlier
This commit is contained in:
@ -64,6 +64,8 @@ public class SendTunnelMessageJob extends JobImpl {
|
||||
_log = ctx.logManager().getLog(SendTunnelMessageJob.class);
|
||||
if (msg == null)
|
||||
throw new IllegalArgumentException("wtf, null message? sod off");
|
||||
if (tunnelId == null)
|
||||
throw new IllegalArgumentException("wtf, no tunnelId? nuh uh");
|
||||
_message = msg;
|
||||
_destRouter = targetRouter;
|
||||
_tunnelId = tunnelId;
|
||||
|
@ -80,10 +80,16 @@ public class HandleDatabaseStoreMessageJob extends JobImpl {
|
||||
msg.setMessageId(_message.getReplyToken());
|
||||
msg.setArrival(new Date(getContext().clock().now()));
|
||||
TunnelId outTunnelId = selectOutboundTunnel();
|
||||
if (outTunnelId == null) {
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
_log.warn("No outbound tunnel could be found");
|
||||
return;
|
||||
} else {
|
||||
getContext().jobQueue().addJob(new SendTunnelMessageJob(getContext(), msg, outTunnelId,
|
||||
_message.getReplyGateway(), _message.getReplyTunnel(),
|
||||
null, null, null, null, ACK_TIMEOUT, ACK_PRIORITY));
|
||||
}
|
||||
}
|
||||
|
||||
private TunnelId selectOutboundTunnel() {
|
||||
TunnelSelectionCriteria criteria = new TunnelSelectionCriteria();
|
||||
|
Reference in New Issue
Block a user