Graylog2 / Graylog2/graylog2-server

Refactor Message class

Open
#4,380 0 comments 0 reactions 0 assignees View on GitHub
infrastructure triaged
Dominant language
Java
Stars
8.1k
Forks
1.1k
Avg merge
1d 20h
Merged PRs (30d)
217

Description

The `Message` class' origins date very far back and the resulting code is not overly clean. There is a lot of overlapping API surface, which can be difficult to use and understand the consequences of.

Worse, we cannot inject anything into newly created Message objects, which means that any additional behavior either needs to be passed in as extra parameters to its various methods, or has to be added to the class itself which really is not be best place to have.

The idea is to create a `MessageProvider` that can be injected wherever new `Message` objects are required. The provider can then make sure that message objects are "injected" with the necessary references to other systems (such as stats recording, message weighers, etc). By creating a special provider we can work around the overhead of injecting directly.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.