LogoLogo
FeedsIntelligenceEngagementsHelpHome
TRADE360 Integration
TRADE360 Integration
  • Integration Guide
  • RMQ connection
    • Connection and Consumption setup
    • Message Deserializing
    • Market/Bet Message Handling
    • How do I work with TRADE360 feed?
  • Message Structure
    • Message Types Overview
    • Message
    • Events
    • Fixture
    • Competition
    • Markets
    • Bets
    • Participant
    • Livescore
    • Settlements
    • Heartbeat
    • Keep Alive
    • Extra Data
    • Outright Fixture
    • Outright Fixture Market
    • Outright League Fixture
    • Outright League Market
    • Outright Settlements
    • Outright League Settlement
    • Example Messages
    • ProviderMarkets
  • APIs
    • Metadata
    • Subscription
    • Distribution
    • Snapshot
    • Notes and Troubleshooting
  • Enumerations
    • Fixture/Scoreboard Status
    • Subscription
    • Message Types
    • Bet Suspension Reasons
    • Fixture Extra Data
    • Status Description
    • Statistics and Incidents
    • Periods
    • Bet Settlements and Statuses
    • Livescore Extra Data
    • Languages
  • SDK
    • SDK Overview
    • Configuration
    • SDK Installation Guide NodeJS
    • SDK Installation Guide .NET
    • SDK Installation Guide Java
  • Code Samples
    • RMQ Consumer (PHP)
    • RMQ Consumer (GO)
    • RMQ Consumer (Node.js)
    • RMQ Consumer (Python)
    • RMQ Consumer (JavaScript)
    • RMQ Consumer (C#)
Powered by GitBook
On this page

Was this helpful?

  1. Code Samples

RMQ Consumer (JavaScript)

PreviousRMQ Consumer (Python)NextRMQ Consumer (C#)

Last updated 6 months ago

Was this helpful?

Make sure to adjust the following fields as described on documentation : * <UserName> = username * <Password> = password * <HostName> = OS - InPlay: / PreMatch: STM - InPlay: / PreMatch: * <VirtualHost> = OS = VirtualHost = "Customers" STM = VirtualHost = "StmPreMatch" / VirtualHost = "StmInPlay" * <PackageID> = should be a number between “_“ for example _100_

const amqp = require('amqplib/callback_api');

const connectionParams = {
  hostname: 'HostName',
  port: 5672,
  username: '<Username>',
  password: '<Password>',
  vhost: 'VHost'
};

const queue = '_<PackageID>_';

amqp.connect(connectionParams, function(error0, connection) {
  if (error0) {
    throw error0;
  }
  connection.createChannel(function(error1, channel) {
    if (error1) {
      throw error1;
    }
    console.log("Waiting for messages in queue:", queue);
    channel.consume(queue, function(msg) {
      console.log("Received message:", msg.content.toString());
    }, {
      noAck: true
    });
  });
});
inplay-rmq.lsports.eu
prematch-rmq.lsports.eu
stm-inplay.lsports.eu
stm-prematch.lsports.eu