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);
|
_log = ctx.logManager().getLog(SendTunnelMessageJob.class);
|
||||||
if (msg == null)
|
if (msg == null)
|
||||||
throw new IllegalArgumentException("wtf, null message? sod off");
|
throw new IllegalArgumentException("wtf, null message? sod off");
|
||||||
|
if (tunnelId == null)
|
||||||
|
throw new IllegalArgumentException("wtf, no tunnelId? nuh uh");
|
||||||
_message = msg;
|
_message = msg;
|
||||||
_destRouter = targetRouter;
|
_destRouter = targetRouter;
|
||||||
_tunnelId = tunnelId;
|
_tunnelId = tunnelId;
|
||||||
|
@ -80,10 +80,16 @@ public class HandleDatabaseStoreMessageJob extends JobImpl {
|
|||||||
msg.setMessageId(_message.getReplyToken());
|
msg.setMessageId(_message.getReplyToken());
|
||||||
msg.setArrival(new Date(getContext().clock().now()));
|
msg.setArrival(new Date(getContext().clock().now()));
|
||||||
TunnelId outTunnelId = selectOutboundTunnel();
|
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,
|
getContext().jobQueue().addJob(new SendTunnelMessageJob(getContext(), msg, outTunnelId,
|
||||||
_message.getReplyGateway(), _message.getReplyTunnel(),
|
_message.getReplyGateway(), _message.getReplyTunnel(),
|
||||||
null, null, null, null, ACK_TIMEOUT, ACK_PRIORITY));
|
null, null, null, null, ACK_TIMEOUT, ACK_PRIORITY));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private TunnelId selectOutboundTunnel() {
|
private TunnelId selectOutboundTunnel() {
|
||||||
TunnelSelectionCriteria criteria = new TunnelSelectionCriteria();
|
TunnelSelectionCriteria criteria = new TunnelSelectionCriteria();
|
||||||
|
Reference in New Issue
Block a user