Injector Microservice Testing for Production Message Flows
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Microservice-based applications are challenging to test effectively due to complex interactions between microservices, requiring end-to-end simulations that are difficult to manage and often impossible to perform in production environments, leading to a need for improved testing methodologies.
Innovation Solution
A computer-implemented method and apparatus using an injector microservice to receive a test configuration file, generate and transmit test messages with identifiers, record output messages, and manage communication mechanisms like Kafka topics or HTTP for comprehensive testing across microservices.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If end-to-end testing is performed in production environment, then testing accuracy is improved, but system complexity and risk increase
Solution Approach 1:
The patent introduces a message injector as an intermediary component that injects test messages into the message stream between microservices. This mediator enables testing in the production environment by injecting synthetic test messages that mimic real user messages, allowing accurate end-to-end testing without directly manipulating production traffic or increasing system complexity.
2Productivity
If test messages are injected into production system, then testing efficiency is improved, but risk of interfering with real traffic increases
Solution Approach 1:
The patent applies local quality by giving test messages a distinctive identifier (test identifier field) that differentiates them from real user messages. This allows the system to treat test messages differently - they can be injected into the production message stream, processed by microservices, and then identified and captured for testing purposes without interfering with or confusing real traffic processing.
Solution Approach 2:
The message injector acts as a mediator that carefully introduces test messages into the production system. It injects messages with unique test identifiers at specific points in the message stream, allowing testing to occur without disrupting real traffic. The injector monitors and captures messages with test identifiers, ensuring that only test messages are affected while real traffic flows uninterrupted.
3Reliability
If microservice interactions are simulated, then testing coverage is improved, but difficulty of managing dependencies increases
Solution Approach 1:
The patent enables microservices to self-identify and self-report test message processing. Each microservice that receives a message with a test identifier automatically processes it normally and then publishes the processed message back to the message stream with the same test identifier. This self-service approach eliminates the need for complex test orchestration or dependency management, as the microservices themselves participate in testing without requiring external coordination.
Data Source
Figure 1
Figure 2
Figure 3~4A
AI summary
A computer-implemented method for testing a functionality of a computing platform, the computing platform comprising a first microservice, the method comprising: receiving, by an injector microservice, a test configuration file; determining from the test configuration file: a test input message; a test input communication mechanism; and a test output communication mechanism. The method further comprises: generating a test identifier for identifying that a message is being used for testing purposes; transmitting, by the injector microservice, the test input message to the first microservice using the test input communication mechanism, wherein the test input message comprises the test identifier; identifying, by the injector microservice, an output message transmitted via the test output communication mechanism that comprises the test identifier; and recording, by the injector microservice, the output message comprising the test identifier.