Here you can see the full list of changes between nameko versions. Versions are in form of headline.major.minor numbers. Backwards-compatible changes increment the minor version number only.
- Improves teardown speed of the rabbit_config pytest fixture
- Support for providing an alternative reply listener to the standalone RPC proxy
- Adds a DependencyProvider to give services access to the config object
- Internal refactor to make all worker lifecycle steps run in the same thread
- Enables publish confirms by default for all AMQP message publishers
- Refactors common AMQP connection code into nameko.amqp
- Adds AMQP heartbeats to Consumer connections
- Handles an uncaught exception caused by a fast-disconnecting client under Python 3 [fixes #367]
- Pins kombu back to a compatible release (<4) [fixes #378]
- Fixes compatibility with latest bpython and ipython shells [fixes #355 and #375]
- Fixes socket cleanup bug in websocket hub [fixes #367]
Added support for environment variables in YAML config files
entrypoint_waiter(). The new implementation is backwards compatible but additionally:
- Gives you access to the result returned (or exception raised)
- Adds the ability to wait for a specific result
- Doesn’t fire until the worker is completely torn down
- Enhanced :class: ~nameko.web.server.WebServer with get_wsgi_app and get_wsgi_server to allow easy usage of WSGI middleware and modifications of the WSGI server.
replace_dependencies()to allow specific replacement values to be provided with named arguments.
- Add dictionary access to
standalone.rpc.ClusterProxyto allow the proxy to call services whose name is not a legal identifier in python (e.g. name has a
- Add the ability to specify a custom ServiceContainer class via config key. Deprecate the keyword arguments to ServiceRunner and run_services for the same purpose.
- Deprecate the keyword arguments to run_services, ServiceContainer and ServiceRunner.add_service for specifying a custom WorkerContext class. Custom WorkerContext classes can now only be specified with a custom ServiceContainer class that defines the worker_ctx_cls attribute.
- Remove the context_keys attribute of the WorkerContext, which was previously used to “whitelist” worker context data passed from call to call. It was a feature that leaked from a specific implementation into the main framework, and not useful enough in its own right to continue to be supported.
- Refactor ServiceContainer internals for better separation between “managed” and “worker” threads. Improved logging when threads are killed.
MethodProxy.asyncin favour of
MethodProxy.call_asyncin preparation for async becoming a keyword
- Add support for loading logging configuration from
- Add support for loading configuration file in
HttpRequestHandlerto allow override how web exceptions are handled
- Enabled reliable delivery on broadcast events when combined with a custom
broadcast_identity. Reliable delivery now defaults to enabled for all handler types. It must be explicitly turned off with broadcast mode unless you override the default broadcast_identity.
- Update bundled pytest fixtures to use a random vhost in RabbitMQ by default
- Now requires eventlet>=0.16.1 because older versions were removed from PyPI
- Add support for alternative serializers in AMQP messages
- Add pytest plugin with common fixtures
- Fix examples in documentation and add tests to prevent future breakage
- Fix bug handling non-ascii characters in exception messages
- Various documentation fixes
- Refactor the standalone queue consumer for more extensibility
- Nameko shell to use bpython or ipython interpreter if available
- Support for marking entrypoint arguments as sensitive (for later redaction)
- Changed default AMQP URI so examples work with an unconfigured RabbitMQ.
- Heuristic messages for AMQP connection errors.
- Added six to requirements.
- Minor documentation fixes.
- python 3 compatibility
- Added HTTP entrypoints and experimental websocket support (contributed by Armin Ronacher)
- Added CLI and console script
- Introduction of nameko “extensions” and nomenclature clarification
- Removal of
DependencyFactoryin favour of prototype pattern
- Complete documentation rewrite
- Spun out
nameko.contrib.sqlalchemyinto nameko-sqlalchemy as a community extension.
- Spun out
nameko.legacypackage into nameko-nova-compat
- Rename the standalone rpc proxy to
ServiceRpcProxyand add a
ClusterRpcProxy, using a single reply queue for communicating with multiple remote services.
- Make the standalone event dispatcher more shell-friendly, connecting on demand.
- Remove parallel provider in favour of async RPC
worker_factory()to raise if asked to replace a non-existent injection.
- Add various
__repr__methods for better logging
- Support for timeouts in the (non-legacy) standalone RPC proxy
- Add helper for manipulating an AMQP URI into a dict
- RPC reply queues now auto-delete.
- Extra protection against badly-behaved dependencies during container kill
- Make legacy
NovaRpcConsumermore robust against failures in the
- Add ability to make asynchronous rpc calls using the rpc proxy.
- Add a new nameko context key
user_agentto support including such info in the rpc header.
- Have the standalone rpc proxy mark its reply queues as auto-delete, to stop them staying around after use.
RpcConsumermore robust against failures in the
- Add a new exception
MalformedRequestthat RPC providers can raise if they detect an invalid message. Raise this exception in the default
kwargskeys are missing from the message.
- Fix issues in queue consumer tests against non-localhost brokers.
- Upgrade to eventlet 0.15.2.
- Include pyrabbit in
requirements.txt(no longer just for tests).
- Catch dying containers in the entrypoint_hook to avoid hangs.
expected_exceptionskwarg to the rpc entrypoint to enable different exception handling (in dependencies) for user vs system errors.
- Add more logging for workers killed by
- Add a default implementation for
None) for dependency providers that are used for side-effects rather than injecting dependencies.
- New test helper
entrypoint_waiter()to wait for entrypoints (e.g. event handlers) to complete.
- Raise a specific
RpcTimeouterror in the RPC proxy rather than
socket.timeoutto avoid confusing kombu’s
- Improve logging helpers
inspect.getcallargsinstead of shadow lambda for RPC argument checking
- Add default retry policies to all publishers
- Stricter handling of connections between tests
- Workarounds for RabbitMQ bugs described at https://groups.google.com/d/topic/rabbitmq-users/lrl0tYd1L38/discussion
- Inspect the service class (instead of an instance) in
worker_factory(). Works better with descriptors.
- Explicitly delete
exc_infovariable when not needed, to help the garbage collector.
- Entrypoint providers’ handle_result is now able to manipulate and modify and
(result, exc_info)tuple. This enables default post-processing (e.g. serialization, translations)
- Added serialization safety to legacy RPC entrypoint.
- Bugfix to exception handling in
- No longer relying on eventlet for standalone RPC proxy timeouts.
- Introduced RPC entrypoints compatible with the ‘legacy’ proxy.
- Documentation generator accepts a function listing event classes and adds to output accordingly.
- Now passing
exc_infotuples instead of bare exceptions to
handle_result, to enable exception processing in non-worker greenthreads.
_run_worker()now calls any
handle_resultmethod before dependency teardown.
- Serialization errors now generate a specific error message rather than bubbling into the container.
- Minor change to
user_iddependency providers to make context data available to service workers.
- Refactored constants into their own module.
- Minor test changes to enable testing on shared rabbit brokers.
killis in progress, since some providers may already be dead. Providers should catch this and e.g. requeue rpc messages. There is a race condition between completing the kill sequence and remaining entrypoints firing.
- Revert changes to legacy exception serialization to maintain backwards compatibility with old clients.
- Add forwards compatibility for future clients that wish to serialize exceptions into more data
- Promote conftest rabbit manipulations to test helpers
- Rename instance_factory to worker_factory
RemoteError: TypeErrorif an RPC method is called with invalid arguments.
RemoteError: MethodNotFoundif a non-existent RPC method is called.
- Let log handlers format warning messages so that aggregators group them correctly.
- Expose the entire dependency provider (rather than just the method name) to the worker context.
kill()enabling better tracebacks and cleaner teardown:
sys.exc_infoto preserve tracebacks
- No longer passing exception into
kill(), removing race conditions.
- No longer requiring
- Adds the
nameko_docpackage, for easing the creation of service-oriented documentation.
- RPC calls to non-existent services (no queues bound to the RPC exchange with the appropriate routing key) now raise an exception instead of hanging indefinitely. Note that calls to existing but non-running services (where the queue exists but has no consumer) behave as before.
- Increased test resilience. Force-closing existing connections on rabbit reset
MagicMockfor dependency replacement in test utilities
autospec=Truewherever possible when mocking
ServiceContainersinto a single class
- Bugfixes enabling reconnection to the broker if the connection is temporarily lost.
- Dropping headers with a
Nonevalue because they can’t be serialized by AMQP
event_handler_clskwarg to the
event_handlerentrypoint, for using a custom subclass of the
- Standalone RPC proxy interface changed to class with contextmanager interface