Jan Burkl
Solution Consulting Manager
Rogue Wave Software
ZendCon 2017, Las Vegas, October 25th 2017
The PHP framework for Middleware applications
A function that gets a request and generates a response
use Psr\Http\Message\ServerRequestInterface as Request;
use Interop\Http\ServerMiddleware\DelegateInterface;
function (Request $request, DelegateInterface $next)
{
// doing something with $request...
// for instance calling the delegate middleware $next
$response = $next->process($request);
// manipulate the $response
return $response;
}
This is called lambda middleware.
You can install Expressive 2.0 using composer:
composer create-project zendframework/zend-expressive-skeleton api
Choose the default options during the installation
“[...] a collection of loosely coupled services.”
en.wikipedia.org/wiki/Microservices
“[...] a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API”
“Current versions of Docker include swarm mode for natively managing a cluster of Docker Engines called a swarm. Use the Docker CLI to create a swarm, deploy application services to a swarm, and manage swarm behavior.”
$ docker swarm init --advertise-addr 192.168.99.121
Swarm initialized: current node (bvz81updecsj6wjz393c09vti) is now a manager.
To add a worker to this swarm, run the following command:
docker swarm join \
--token SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx \
172.17.0.2:2377
To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.
“The routing mesh enables each node in the swarm to accept connections on published ports for any service running in the swarm, even if there’s no task running on the node.”
$ docker stack deploy --compose-file stack.yml pm
Install and Update
$ docker build -t particulum-mobile/backend .
builds images on-the-fly
Particulum Mobile, Portainer, Visualizer
Session Handling?
Just a Docker Compose file modification
Expressive
Contact me: jan.burkl [at] roguewave.com
Follow me: @5square_de