# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;
-use JSON qw( encode_json decode_json );
+use JSON qw( decode_json encode_json );
use Carp qw( croak );
use Net::Stomp;
-use Try::Tiny;
+use Try::Tiny qw( catch try );
use C4::Context;
use Koha::DateUtils qw( dt_from_string );
$credentials->{host} = $config->{vhost} if $config->{vhost};
}
my $stomp = Net::Stomp->new( { hostname => $hostname, port => $port } );
- my $frame = $stomp->connect( $credentials );
- unless ($frame && $frame->command eq 'CONNECTED'){
- if ($frame){
- warn $frame->as_string;
- }
- die "Cannot connect to message broker";
- }
+ $stomp->connect( $credentials );
return $stomp;
}