B4J Question MQTT for SMS return Messages?

AKJammer

Active Member
Licensed User
Hey All,
Before I get too far down this rabbit hole I figured I'd ask the community. I have a B4J project and have been able, with great help from everyone, to get outgoing SMS texting set up and working. I wasn't planning on having two way communication, but since I've got extra time now due to Covid, I decided to look into it. I'll have to figure out what a webhook is (yeah, I'm old, but haven't done a lot of webbie stuff. give me some Fortran, Cobol or even C and I'm hell on wheels) and how to use it, but eventually it boils down to communication. My app, along with the database, will be at various Hotels over the weekends so I won't have any set IP address. What I'm thinking of doing is setting up a webhook at a known web hosting point, then connect it to an MQTT server (myqtthub.com is free for small applications). Then I would have my B4J program subscribe to the messages and be able to get the return traffic from SMS.
Does that sound feasible or is there a better way than using MQTT? I think MQTT gives me the flexibilty with not knowing where I am, but who knows.... Do we have any examples of building a webhook or B4J connecting to MQTT? I know there are many examples for MQTT with B4A, do I use those and adapt them?

Thanks,
Jim
 

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
A webhook is a fancy way to say an HTTP call to your server that means that you will need B4J + JServer to get the information, if you already will receive that information with those 2, you dont really need MQTT at all.
 
Upvote 0

AKJammer

Active Member
Licensed User
The webhook has to be set up with Nexmo (the SMS provider) though. It needs a fixed webhost in order to do that.
hmmmmm.........So you're saying I can just create a B4J web monitor (SMS Webhook) at my web hoster (Powweb), then connect in with my application also to see if I've gotten any messages. Check it once an hour is probably sufficient. Ok, yes, that cuts MQTT out of the requirement. I can still connect from anywhere to check it. Cool. I'll do some searching for JServer to see if I can find examples. Thanks!!
 
Upvote 0

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
Nexmo (the SMS provider) though
Yes! everytime an sms comes back you will receive an http call from Nexmo, you will process that information with Jserver.

my web hoster (Powweb)
i dont know, ask yourself if you have root access and can install java and manage, you need at least a VPS.

Check it once an hour is probably sufficient
yes, just store whatever comes from Nexmo and save it to a database.
 
Upvote 0

AKJammer

Active Member
Licensed User
Just an FYI for anyone reading this in the future. Was able to get a VPS server for $2/mo from ionos.com. It's not a monster box by any means, but it runs java and apache just fine and should be able to run my B4x servlets without a problem.
Thanks Enrique. Check's in the mail
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…