mercredi 13 avril 2016

Pattern - Communication that is always initiated by the same party

I need help finding an efficient pattern for a part of the application I'm developing.

Every user has a device called a Gateway. These gateways are communicating with the online system of the application via the GatewayLogic. So the GatewayLogic is the entry-point to the online system and all user's gateways are connected to it. This communication is done via the 3G-network.

There is one constraint. Since IP-addresses on the 3G-network change frequently, communication between a Gateway and the GatewayLogic always has to be initiated by the Gateway. The problem is that data has to travel both ways. Data has to reach the gateways from the online system and data has to reach the online system from the gateways. So this is essentially two way communication that is always initiated by one component, the Gateway.

I'm thinking about tackling this by having the GatewayLogic maintain a queue for every gateway. Each Gateway periodically polls his queue on the GatewayLogic for new data. But I'm not sure if this solution is scalable enough.

My question is: Is there a design pattern to solve this problem in a more efficient manner?

Aucun commentaire:

Enregistrer un commentaire