Thanks to visit codestin.com
Credit goes to github.com

Skip to content

get parent location from an embedded service #598

@klag

Description

@klag

In the test get-parent-location.ol added in this branch https://github.com/jolie/jolie/tree/enhancement/get-parent-location it is reported the use case where it is necessary to have a getLocalParentLocation@Runtime from an embedded service.

In the proposed scenario, there is an embedded service called JsonSchema imported from json-schema-get-parent-location.ol. This service embeds two private services JsonSchema2 and JsonSchema3 which re-implements a subset of the api of JsonSchema (depending on the json schema version requested).
The problem is that the api of JsonSchema2 and JsonSchema3 require to call back the other operations of the parent JsonSchema.

The solution is solved defining an internal localtion "local://internalJsonSchema" for binding the children to the parent.

BUT

if we import JSonSchema twice, an "Address already used"error is raised because the location "local://internalJsonSchema" has been reserved by the first instance of JsonSchema.

This architecture is very interesting for addressing the Strangler Pattern. I think that having a getLocalParentLocation@Runtime could definitively solve this problem by allowing a child to bind an outputPort to the parent.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions