From: Bill Erickson Date: Thu, 16 Feb 2023 17:13:20 +0000 (-0500) Subject: Fix multi-domain routing issues w/ router reg X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=327fd9d574cfa96985f89e30660d60b264b77156;p=working%2FOpenSRF.git Fix multi-domain routing issues w/ router reg Signed-off-by: Bill Erickson --- diff --git a/src/libopensrf/transport_client.c b/src/libopensrf/transport_client.c index a8499ca..435f1aa 100644 --- a/src/libopensrf/transport_client.c +++ b/src/libopensrf/transport_client.c @@ -53,7 +53,7 @@ static transport_con* get_transport_con(transport_client* client, const char* do transport_con_set_address(con, NULL); // Connections to remote domains assume the same connection - // attributes apply. + // attributes apply, minus the domain. transport_con_connect(con, client->port, client->username, client->password); return con; @@ -154,7 +154,7 @@ int client_send_message_to(transport_client* client, transport_message* msg, con transport_con* con; - if (strstr(receiver, "opensrf:client")) { + if (strstr(receiver, "opensrf:client") || strstr(receiver, "opensrf:router")) { // We may be talking to a worker that runs on a remote domain. // Find or create a connection to the domain. diff --git a/src/perl/lib/OpenSRF/Transport/Redis/Client.pm b/src/perl/lib/OpenSRF/Transport/Redis/Client.pm index eff90a3..7bdab28 100644 --- a/src/perl/lib/OpenSRF/Transport/Redis/Client.pm +++ b/src/perl/lib/OpenSRF/Transport/Redis/Client.pm @@ -156,14 +156,14 @@ sub send_to { my $msg_json = $msg->to_json; my $con = $self->primary_connection; - if ($recipient =~ /^opensrf:client/o) { + if ($recipient =~ /^opensrf:client/o || $recipient =~ /^opensrf:router/o) { # Clients may be lurking on remote nodes. # Make sure we have a connection to said node. # opensrf:client:domain:... my (undef, undef, $domain) = split(/:/, $recipient); - my $con = $self->get_connection($domain); + $con = $self->get_connection($domain); if (!$con) { $logger->error("Cannot send message to node $domain: $msg_json"); return;