Bridging ZeroMQ and HTTP

As you have seen in this chapter, ZeroMQ offers a lot of different possibilities for implementing communication between separate services. In particular, patterns such as publish/subscribe and push/pull are not that easy to implement with PHP's de-facto standard protocol, HTTP.

On the other hand, HTTP is more widely adopted and offers a richer set of protocol semantics, handling concerns such as caching or authentication already at the protocol-level. Because of this, especially when offering external APIs, you might prefer offering an HTTP-based API instead of a ZeroMQ-based API. Luckily, it's easy to bridge between the two protocols. In our example architecture, the checkout service is the only service that will be used ...

Get PHP 7 Programming Blueprints now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.