container_factory and runner_factory now take custom config argument (as they used to in Nameko 2.X). Config patch is applied if a config dictionary is passed to these factories. (#610)β A small tweak to the new config API introduced in rc4. Improves the naming and adds a decorator interface for simpler, more explicit use in tests.
β Addresses a limitation whereby context data changed during method execution was not propagated to downstream services.
Example:
from nameko.messaging import Consumerfrom nameko import configclass Service: @consume( queue=Queue( exchange=config["MY\_EXCHANGE"], routing\_key=config["MY\_ROUTING\_KEY"], name=config["MY\_QUEUE\_NAME"] ), prefetch\_count=config["MY\_CONSUMER\_PREFETCH\_COUNT"] ) def consume(self, payload): pass
π§ Configuration may now be declared on the CLI:
$ nameko run service \ --define AMQP_URI=pyamqp://user:pass@host/vhost \ --define MY_EXCHANGE="exchange" \ --define MY_ROUTING_KEY="route" \ --define MY_QUEUE_NAME="queue" \ --define MY_PREFETCH_COUNT=100 \
π§ Configuration access via the service container is now deprecated.
π§ Builtin extensions and other facilities that read the configuration now access it via the global
π Fixes minor issues discovered during pre-release testing:
ClusterRpcProxy and ServiceRpcProxy in nameko.standalone.rpcEventHandler and Consumer entrypoints could not accept expected_exceptions or sensitive_arguments keywords.β Adds a ClusterRpc DependencyProvider, allowing services to make RPC calls without prior knowledge of the target service name.
β Additonally removes the word "proxy" from RPC clients:
ServiceRpcProxy renamed to ServiceRpcClientClusterRpcProxy renamed to ClusterRpcClientServiceRpcProxy renamed to ServiceRpcClusterRpc added)The old names have been preserved for backwards compatibility.