Hi,
You can get an instance of org.smslib.Service and then add as much
gateways as you want. Default load balancing is roundRobin I think but you
can override it to create your own balancing algorithm *(
org.smslib.balancing.RoundRobinLoadBalancer):*
*Sample adding multiple gateways:*
Service srv = Service.getInstance();
for (ServerConfiguration sc : smppServers.values())
{
currentServer = sc;
String ID = currentServer.getID();
String ip = currentServer.getIp();
String port = currentServer.getPort();
String username = currentServer.getUsername();
String passwd = currentServer.getPwd();
String type = currentServer.getType();
gateway = new JSMPPGateway(ID,
ip,
Integer.parseInt(port),
new BindAttributes(username, passwd,
type,
BindAttributes.BindType.TRANSMITTER));
logger.info("INFSMS Adding gateway " + gateway.getHost() + ":"
+ gateway.getPort() + " to service...");
srv.addGateway(gateway);
}
//then just start srv
srv.startService();
You have to digg a bit to deal with disconnection and the best way to
reconnect gateways. In my case, I stop srv, remove gateways and rerun the
same code to load configuration from database ;)
Le lundi 16 septembre 2013 10:13:34 UTC+1, Iman a écrit :
>
> Hi
>
> im creating web base sms application and i need a hand on below questions.
>
> how can i reconnect all the smpp connection in case of disconnection, keep
> them live, and keep all the logs from each smpp in DB? do i need to write a
> code for every smpp connection (i will have more than 50 smpp connection)
> or is there a way i can check everyone of them at once and if there is a
> disconnection to make it connect.
>
> Any help will be appreciated
>
> Regards
>
--
You received this message because you are subscribed to the Google Groups
"SMSLib Discussion Group" group.
To view this discussion on the web visit
https://groups.google.com/d/msgid/smslib/b800a0fc-37dc-4976-bf3d-c7193734d40a%40googlegroups.com.