You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by fidoedidoe <ga...@sagepub.co.uk> on 2015/05/14 20:46:07 UTC
camel-hipchat (15.2) using XML DSL, can't set HipchatToUser
Hi,
Can you help. I'm implementing a route to post messages into a HipChat room.
Using XML DSL, I have successfully posted message to a HipChat Room, albeit
without sending the message to specific people within the room.
To achieve the latter (targeting messages to people in the hipchat room). I
set the header: HipchatToUser and named a known person, myself (aka
@MyNameHere), but it's no notifying me. My route snippet is:
Oddly if I change the body of the message to include the person name it
works, but this feels like a hack.
Has anyone else had better success and/or could point me in the right
direction (I'm still pretty new to camel / DSL)
Many thanks!
--
View this message in context: http://camel.465427.n5.nabble.com/camel-hipchat-15-2-using-XML-DSL-can-t-set-HipchatToUser-tp5767120.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: camel-hipchat (15.2) using XML DSL, can't set HipchatToUser
Posted by shreyaspurohit <sh...@hotmail.com>.
Hello,
I am using hipchat component with camel 15.0 and the below route works for
me. It just reads a file dropped in folder and hipchat's the filename as
message. I use scala with java dsl and not XML. Few things I suggest to
debug issue:
1. Try a simple java DSL like mine and see if that works
2. Does it work with camel 15.0?
I hope this is not related to "@" symbol in your XML being set in header
getting encoded or something.
object HipchatUserMessageSender {
def main(args: Array[String]): Unit = {
val camelMain: Main = new Main()
camelMain.enableHangupSupport()
camelMain.addRouteBuilder(new HipchatUserSendRB)
camelMain.run()
}
}
class HipchatUserSendRB extends RouteBuilder {
val hipchatOut = "hipchat://?authToken=AAAAA"
val fileUrlIn =
s"""
file:/tmp/hipchat?
readLock=changed&
delete=true&
readLockMinLength=0
""".lines.map(_.trim).mkString
override def configure(): Unit = {
from(fileUrlIn)
.setHeader(HipchatConstants.TO_USER, constant("@451"))//yes, thats my
handle
.setBody(simple("in.header.CamelFileName"))
.setHeader(HipchatConstants.TRIGGER_NOTIFY, constant(true))
.to("log:hipchat?showAll=true&multiline=true")
.to(hipchatOut)
}
}
--
View this message in context: http://camel.465427.n5.nabble.com/camel-hipchat-15-2-using-XML-DSL-can-t-set-HipchatToUser-tp5767120p5767132.html
Sent from the Camel - Users mailing list archive at Nabble.com.