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 the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.