Page MenuHomeDevCentral

Broker factory
ClosedPublic

Authored by dereckson on Jan 12 2016, 00:27.
Tags
None
Referenced Files
F3910424: D225.id.diff
Wed, Dec 18, 23:26
Unknown Object (File)
Mon, Dec 16, 23:40
Unknown Object (File)
Thu, Dec 12, 21:06
Unknown Object (File)
Wed, Dec 11, 06:12
Unknown Object (File)
Wed, Dec 11, 05:51
Unknown Object (File)
Wed, Dec 11, 05:50
Unknown Object (File)
Wed, Dec 4, 17:46
Unknown Object (File)
Wed, Dec 4, 17:46
Subscribers
None

Details

Summary

Applications consuming our library wants generally to declare the broker
in the configuration, including its type.

We provide a BrokerFactory::make method to instanciate a broker with
an array like this:

[
    "driver" => "amqp",
    "host" => "rabbit.domain.tld",
    "port" => "5672",
    "username" => "lorem",
    "password" => "ipsum",
    "vhost" => "dolor",
]

The file drivers.php contains the map between the drivers names
and the classses to load.

Each broker class implements a makeFromConfig ($params) static method
to build an object from such array.

The BrokerFactory::make method gets from drivers.php the correct class,
then calls makeFromConfig and returns the result.

Test Plan

Run tests

Diff Detail

Repository
rKBROKER Keruald Broker
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dereckson retitled this revision from to Broker factory.
dereckson updated this object.
dereckson edited the test plan for this revision. (Show Details)
dereckson added a reviewer: dereckson.
dereckson edited the test plan for this revision. (Show Details)
dereckson edited edge metadata.
This revision is now accepted and ready to land.Jan 12 2016, 00:29
This revision was automatically updated to reflect the committed changes.