{"record":{"id":"02127e4c86023525","repo":"fluent/fluentd","slug":"deprecated-method-this-method-is-going-to-be-dele-02127e","errorCode":null,"errorMessage":"Deprecated method: this method is going to be deleted. Use Fluent::MessagePackFactory.msgpack_packer","messagePattern":"Deprecated method: this method is going to be deleted\\. Use Fluent::MessagePackFactory\\.msgpack_packer","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"lib/fluent/msgpack_factory.rb","lineNumber":34,"sourceCode":"\nrequire 'msgpack'\nrequire 'fluent/time'\n\nmodule Fluent\n  module MessagePackFactory\n    @@engine_factory = nil\n\n    module Mixin\n      def msgpack_factory\n        unless @deprecated_log_done\n          deprecated_log('Deprecated method: this method is going to be deleted. Use Fluent::MessagePackFactory.engine_factory')\n        end\n        MessagePackFactory.engine_factory\n      end\n\n      def msgpack_packer(*args)\n        unless @deprecated_log_done\n          deprecated_log('Deprecated method: this method is going to be deleted. Use Fluent::MessagePackFactory.msgpack_packer')\n        end\n        MessagePackFactory.msgpack_packer(*args)\n      end\n\n      def msgpack_unpacker(*args)\n        unless @deprecated_log_done\n          deprecated_log('Deprecated method: this method is going to be deleted. Use Fluent::MessagePackFactory.msgpack_unpacker')\n        end\n        MessagePackFactory.msgpack_unpacker(*args)\n      end\n\n      def deprecated_log(str)\n        if $log\n          $log.warn(str)\n          @deprecated_log_done = true\n        end\n      end\n    end","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/msgpack_factory.rb#L16-L52","documentation":"Fluent::MessagePackFactory::Mixin#msgpack_packer is a deprecated shim: it warns once per object via deprecated_log and delegates to Fluent::MessagePackFactory.msgpack_packer(*args). Plugins should obtain packers from the module function directly; the shared engine factory is what both paths use, so behavior is identical.","triggerScenarios":"A plugin that includes Fluent::MessagePackFactory::Mixin calls msgpack_packer (with optional args like an io sink) to serialize records.","commonSituations":"Legacy plugins or copied code using the mixin's instance helpers for MessagePack packing in multi-process/forwarding code paths.","solutions":["Replace msgpack_packer(...) with Fluent::MessagePackFactory.msgpack_packer(...).","Remove the now-unneeded include Fluent::MessagePackFactory::Mixin.","Grep the plugin for msgpack_factory/msgpack_unpacker mixin calls and migrate them together."],"exampleFix":"# before\ninclude Fluent::MessagePackFactory::Mixin\npacker = msgpack_packer(io)\n\n# after\npacker = Fluent::MessagePackFactory.msgpack_packer(io)","handlingStrategy":"validation","validationCode":"# CI guard: fail on mixin-style msgpack_packer calls\n# grep -rn '^\\s*packer\\s*=\\s*msgpack_packer\\|[^.]msgpack_packer(' lib/ --include='*.rb' && exit 1 || exit 0","typeGuard":"Fluent::MessagePackFactory.respond_to?(:msgpack_packer) # module-level API present and preferred","tryCatchPattern":null,"preventionTips":["Use Fluent::MessagePackFactory.msgpack_packer(...) explicitly in new code.","Drop include Fluent::MessagePackFactory::Mixin during routine plugin maintenance to surface remaining uses at test time."],"tags":["deprecation","msgpack","serialization","plugin-api"],"backgroundTag":"deprecated-method-migration","analyzedSha":"dd45c6e18dc7be33b5e5a0f0767bf46307ff5626","analyzedAt":"2026-08-21T16:22:07.332Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}