I want to setup spring-integration-xmpp on my spring app to make it receive upstream messages from android devices. I can already send messages to the android device using http but I cannot set up the xmpp-connection bean so it gives me:
failed to connect to gcm-preprod.googleapis.com; nested exception is Connection failed. No response from server.:
This is my spring integration configuration:
<int:channel id="gcmOutboundNotificationChannel"/>
<int-xmpp:xmpp-connection
id="xmppConnection"
user="${tracker.server.app.id}@gcm.googleapis.com"
password="${tracker.auth.key}"
host="gcm-preprod.googleapis.com"
port="5236"
subscription-mode="accept_all"/>
<int-xmpp:outbound-channel-adapter
id="gcmOutboundAdapter"
xmpp-connection="xmppConnection"
channel="gcmOutboundNotificationChannel"/>
tracker.server.app.id
is a 12 digit number
and tracker.auth.key
is like AIzaSyBdfZ4oBaVuu07sjW5e9DnogeUF6NV****
(I put in the asterisks).
What am I missing?
I have configured the xmpp connection as a bean like this:
The configuration is autowired in the xml configuration like this:
The last piece is androidMessageTransformer, it's pretty simple, like the gcmXmppConnection bean it was coded along the example in google documentation.
This works reliably for me, although I have mostly worked with the outbound direction, and never checked much about the inbound side.
I think you are missing
auto-startup="true"
in the<int-xmpp:outbound-channel-adapter
tag. Refer to the following answer might work for you.