简体   繁体   中英

Will Apache camel be used between SQL server and Activemq?

Working of Application Currently: I have written a trigger for a table in SQL server to trigger a external java application(which is in tomcat server) through http request whenever there is insertion in that table. I used xp_cmdshell inside trigger like

Exec xp_cmdshell 'sqlps -command "$http=New-Object system.Net.WebClient;
$http.uploadString(\"http://127.0.0.1:8080/MessageProducer\",\"param1=somevalue ^& param2=thriu\")"'

The java application is written to take the queryString and produce message in activemq . Finally I get message in activemq whenever there is insertion in SQL server .

Working of Application I want: SQL server is capable of send message whenever there is update/insert in SQL server, so why should I use java application as intermediate between SQL server and activemq. Is there a way to send message from SQL server to activemq. While I code for activemq I came across Apache camel , will this help for me?.

You don't really have to use any intermediate software such as your Tomcat thing or Apache Camel if you don't want to. ActiveMQ can receive messages right out of the box the way you send it today.

It will be something like this (you might want to add authentication if needed):

Exec xp_cmdshell 'sqlps -command "$http=New-Object system.Net.WebClient;
$http.uploadString(\"http://localhost:8161/api/message/TEST?type=queue\",\"param1=somevalue ^& param2=thriu\")"'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM