Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MQ中Message<DomainEvent>增加入参获取方式 #20

Open
wangyuheng opened this issue Oct 16, 2020 · 0 comments
Open

MQ中Message<DomainEvent>增加入参获取方式 #20

wangyuheng opened this issue Oct 16, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@wangyuheng
Copy link
Owner

背景

MQ通过Message传递参数,但是无法快速获取入参。

方案

通过ExecutionInput解析参数较为复杂

    private Optional<Argument> getArgumentByName(ExecutionInput input, String name) {
        return parser.parseDocument(input.getQuery())
                .getDefinitionsOfType(OperationDefinition.class).stream()
                .map(OperationDefinition::getSelectionSet)
                .map(it -> it.getSelectionsOfType(Field.class))
                .filter(Objects::nonNull)
                .flatMap(Collection::stream)
                .map(Field::getArguments)
                .filter(Objects::nonNull)
                .flatMap(Collection::stream)
                .filter(it -> it.getName().equals(name))
                .findAny();
    }

考虑通过新属性传递,或者提供相关工具扩展

验收

MQ consumer 可以快速获取入参

@wangyuheng wangyuheng added the enhancement New feature or request label Oct 16, 2020
@wangyuheng wangyuheng added this to the 1.2.0 milestone Nov 19, 2020
@wangyuheng wangyuheng modified the milestones: 1.2.0, 1.3.0, 1.4.0 Dec 3, 2020
@wangyuheng wangyuheng removed this from the 1.4.0 milestone Dec 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant