Skip to content

Instantly share code, notes, and snippets.

@EsikAntony
Created January 11, 2017 13:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EsikAntony/5572caaf995a01b95203607b40d0b0e2 to your computer and use it in GitHub Desktop.
Save EsikAntony/5572caaf995a01b95203607b40d0b0e2 to your computer and use it in GitHub Desktop.
public static void main(String[] args) throws JMSException, IOException {
ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("tcp://locserv:61616");
cf.setUserName("admin");
cf.setPassword("admin");
Connection connection = cf.createConnection();
connection.start();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer producer = session.createProducer(session.createQueue("kuvdRecords"));
producer.send(
session.createTextMessage(
Files.readLines(
new java.io.File("C:\\Users\\aesik\\workspace\\rrm-ppoz\\services\\validation-service\\app\\src\\main\\resources\\message.json")
, Charset.defaultCharset()
).stream()
.collect(Collectors.joining())
)
);
session.close();
connection.stop();
connection.close();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment