Unified java api to integrate with multiple SMS gateways - java

I'm building a common messaging service for our distributed micro services solution to send SMS notifications for the users using Spring Boot, this service should be configurable with N number of SMS gateways providers (Nexmo, Twilio, Twizo, etc.) according to our customers, so any suggestions for unified java api to handle this case instead of hacking the code every time I have a new SMS gateway?

You can decouple your code with the SMS gateways by middleware such as message queue or JMS. You just push your SMS message to the MQ and then the SMS gateways act as comsumers to consume these messages.

Related

Is it possible to consume message from AWS SNS without creating Subscription like ActiveMQ?

When any message publishes to AWS SNS Topic then the listener (java code) can consume the message from SNS Topic without creating any subscriber. I want to achieve a publish-subscriber pattern like ActiveMQ using AWS SNS.
You can configure an AWS lambda function using java as its runtime environment to get triggered using AWS SNS. More info can be found here.
In general, pub/sub systems always require subscriptions to receive messages.
However, Amazon SNS supports delivering messages to platform application endpoints (for delivering push notifications) and phone numbers (for sending SMS) without creating subscriptions. All other types of destinations will require a subscription.
AWS has two "messaging" services:
SNS (Simple Notification Service): Send "notifications" to an "endpoint"
SQS (Simple Queue Service): a fully managed message queuing service
If you WANTED pub/sub (analogous to ActiveMQ sub/sub), then you'd probably use SQS.
To answer your question: No, you DON'T need to create a "subscriber".
Strictly speaking, you don't even need to create an SNS Topic: just fire off a "message" to an "endpoint". Per the documentation:
https://docs.aws.amazon.com/sns/latest/dg/sns-create-topic.html
SNS topic is a logical access point that acts as a communication channel. A topic lets you group multiple endpoints (such as AWS
Lambda, Amazon SQS, HTTP/S, or an email address).
Your challenge is how to get an external Java app to "listen" for the notification. This AWS example, Working with Amazon Simple Notification Service creates a topic and assigns a subscriber. It's a good solution ... but there are plenty of other alternatives. It all depends on your application, the application's platform... and your personal preference.

Consuming MassTransit+RabbitMQ messages in non .Net applications

I plan to implement the message bus where messages would be produced in .Net Core application but consumer applications are to be running on Android devices and written on Java. In initial approximation publisher application will know nothing about consumers. Java tablets will subscribe to message bus, receive messages and unsubscribe from bus. It looks like I'll need to dynamically create queue for each of the Android tablets, bind it to fanout exchange and send messages to the exchange or something like that. For .Net there is the MassTransit framework that already have all this stuff but I am not aware of Java and Android Studio capabilities. I am curious is there any way or a workaround to implement MassTransit consumer application on Java? I've been googling about 2 hours and didn't find any info but I assume that my search requests were incorrect.
MassTransit uses JSON by default for messages, the structure of which is documented on the web site. You can also send raw JSON messages if the envelope structure used by default is unnecessary.
As for how to consumer RabbitMQ messages from an Android device, I don't have any input there. Surely there is a client SDK.

Java application with azure service bus

I have an audit service. other application will call that service for auditing purpose. my concern is all call to audit service to be queued in azure service bus to make sure fault tolerance.please help me with how to queue other service call to audit service.
Now that you already have considered using service bus, there is no concern about fault tolerance. That's the exactly feature of Azure Service Bus.
Let the other services send message to the queues and your audit service receive those messages to consume them in the order.
You could create queues using the Azure portal, PowerShell, CLI, or Resource Manager templates. You then send and receive messages using a QueueClient object.
To quickly learn how to create a queue, then send and receive messages to and from the queue, see the quickstarts for each method. For a more in-depth tutorial on how to use queues, see Get started with Service Bus queues.
For a working sample, see the BasicSendReceiveUsingQueueClient sample on GitHub.
Then if you concern fault tolerance about audit service,you could use ReceiveAndDelete mode. ReceiveAndDelete mode is the simplest model and works best for scenarios in which the application can tolerate not processing a message if a failure occurs.More details, please refer to this link.

role of esb in http rest services?

I have large number of http REST based API implemented in java being reused by multiple services and web/mobile clients.
I have been told that services are connecting based on point to point integration, in other words, if an orchestration service A wants to use rest based service B and C, it uses their load balanced IP. I can esily add more service instances behind the load balancer. So, what would i gain by using ESB?
ESB is more intelligent than a load balancer. Many ESBs offer load balancer capabilites too.
ESB comes into play when you want to connect to services that adhere to different message formats. Say, you have a service that is REST based and can process http payload. But you have a client that sends only jms messages with that payload. An ESB can handle this case. It acts as an integrator accepting the jms messages and converts it to payload.
You might want an ESB even if you are connecting to services talking the same message format. ESB can inspect and transform the message too.

sending bulk sms using springMVC

I am developing an application in wihch involvees sending sms to many mobiles using Spring MVC. Can anyone please help me in this regard. Please also tell me the if any hardware component required, for now i am using a SMS Gateway.
Here nothing to do with Spring MVC as server side you need to handle the load. Better have look SMSLib http://smslib.org/. SMSLib support bulk SMS handling and you can go with GSM Modem or SMS Gateway.

Categories

Resources