Created
January 11, 2017 13:13
-
-
Save EsikAntony/5572caaf995a01b95203607b40d0b0e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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