{"record":{"id":"06cc052fb764673b","repo":"fluent/fluentd","slug":"deprecated-method-this-method-is-going-to-be-dele-06cc05","errorCode":null,"errorMessage":"Deprecated method: this method is going to be deleted. Use Fluent::MessagePackFactory.engine_factory","messagePattern":"Deprecated method: this method is going to be deleted\\. Use Fluent::MessagePackFactory\\.engine_factory","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"lib/fluent/msgpack_factory.rb","lineNumber":27,"sourceCode":"#\n#    Unless required by applicable law or agreed to in writing, software\n#    distributed under the License is distributed on an \"AS IS\" BASIS,\n#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n#    See the License for the specific language governing permissions and\n#    limitations under the License.\n#\n\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","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/msgpack_factory.rb#L9-L45","documentation":"Fluent::MessagePackFactory::Mixin#msgpack_factory is a deprecated convenience method: it warns once per object (@deprecated_log_done) and then returns Fluent::MessagePackFactory.engine_factory. The Mixin exists for pre-1.x plugin compatibility; new code should call the module function directly.","triggerScenarios":"A plugin includes Fluent::MessagePackFactory::Mixin and calls msgpack_factory (typically to build packers/unpackers for custom MessagePack serialization in overriden methods).","commonSituations":"Plugins written for Fluentd v0.12-style APIs, or code copy-pasted from older plugins, still exercising the mixin accessor.","solutions":["Replace msgpack_factory with Fluent::MessagePackFactory.engine_factory and drop the Mixin include.","For packers/unpackers specifically, use Fluent::MessagePackFactory.msgpack_packer/msgpack_unpacker.","Audit the plugin for the other deprecated mixin accessors (msgpack_packer, msgpack_unpacker) in the same pass."],"exampleFix":"# before\nclass MyInput < Fluent::Plugin::Input\n  include Fluent::MessagePackFactory::Mixin\n  def some_method\n    factory = msgpack_factory\n  end\nend\n\n# after\nclass MyInput < Fluent::Plugin::Input\n  def some_method\n    factory = Fluent::MessagePackFactory.engine_factory\n  end\nend","handlingStrategy":"validation","validationCode":"# CI guard: fail on deprecated MessagePackFactory::Mixin accessors\n# grep -rn '\\bmsgpack_factory\\b' lib/ --include='*.rb' | grep -v 'Fluent::MessagePackFactory' && exit 1 || exit 0","typeGuard":"factory = Fluent::MessagePackFactory.respond_to?(:engine_factory) ? Fluent::MessagePackFactory.engine_factory : fallback_factory","tryCatchPattern":null,"preventionTips":["Call Fluent::MessagePackFactory module functions directly; never include the Mixin in new plugins.","When copying plugin code, search it for msgpack_factory/msgpack_packer/msgpack_unpacker and migrate all three."],"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"}