Message Chain

Written by

in

Description

A chain of service calls and messages fulfills common functionality.

Context

Derived from: “Message Chain”
Multiple services exist that call each other sequentially to fulfill an abstraction or business process. Overly aggressive delegate hiding can cause structures in which it is hard to see where the functionality is actually occurring.

Cause

The organization may have created a detailed map of processes, which resulted in a series of grand “end to end” process models that are categorized by their large number of steps and a lack of sub-processes. However, no valid business services have been identified and thus the process maps have been created without a proper service structure. This makes identifying valid services a tricky process, especially when looking for cross-functional or horizontal services.

Consequences

Such a chain may slow down performance and reduces the availability of the chained abstraction. It may also be harder to change the abstraction, especially with respect to the invocation order of services.

Detection

Restricted to Service Chains: a transitive Service Chain with at least four relations exists.

Solution

The first resolution is to create the services architecture independently of the process map. This will provide a structure for breaking down processes and creating a clear hierarchy of use. Next, this service architecture should be compared with the process map to understand where the cuts should be made. The current system can then be incrementally refactored to create a more service-oriented solution by attacking major inflexibilities in the system.

Example

Services are called one after the other in a chain.

Cypher query

MATCH (m) where toLower(m.ClassName) CONTAINS 'service' <br /> CALL apoc.path.expand(m, 'TriggeringRelationship>|FlowRelationship>|AssociationRelationship>|AssignmentRelationship>', '+BusinessService|+ApplicationService|+TechnlogyService', $minLevel, $maxLevel)  <br /> Yield path as p<br /> return p

Cypher count query

MATCH (m) where toLower(m.ClassName) CONTAINS 'service' <br /> CALL apoc.path.expand(m, 'TriggeringRelationship>|FlowRelationship>|AssociationRelationship>|AssignmentRelationship>', '+BusinessService|+ApplicationService|+TechnlogyService', $minLevel, $maxLevel)  <br /> Yield path as p <br /> return count (DISTINCT m)

Diagram

Diagram for Message Chain

Aliases

Service Chain

Tags

microservices, soa, application, technology, The Couplers, between elements, automatic detection

Query parameters

[
    {
        "name": "minLevel",
        "type": "number",
        "default": 4,
        "description": "The minimum length that the query considers for detecting a message chain."
    },
    {
        "name": "maxLevel",
        "type": "number",
        "default": 10,
        "description": "The maximum length that the query considers for detecting a message chain."
    }
]

Related smells

All smells