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

Log details of service invocation from composite services and provide it only to caller. #27

Open
takawitter opened this issue Aug 5, 2015 · 2 comments

Comments

@takawitter
Copy link
Member

No description provided.

@takawitter
Copy link
Member Author

b74e6fe
c095100
Add rpc header: X-ServiceGrid-ServiceContainer-GatherInvocationLog to enable invocation logging on service container.
You can use it with the header X-ServiceGrid-TransferToEndpoint- to pass that header to service container like:

    TranslationWithTemporalDictionaryService s = Context.createSoapClient(
            getClass(),
            TranslationWithTemporalDictionaryService.class,
            new BindingNode("TranslationPL", "KyotoUJServer"),
            new BindingNode("MorphologicalAnalysisPL", "TreeTagger")
        );
    ((RequestAttributes)s).addRequestMimeHeader(
            LangridConstants.HTTPHEADER_TRANSFER_TO_ENDPOINT +
            LangridConstants.HTTPHEADER_SERVICECONTAINER_GATAHER_INVOCATION_LOG,
            "true");
    Assert.assertTrue(s.translate("en", "ja", "hello", new Translation[]{}, "ja").length() > 0);
    for(RpcHeader h : ((ResponseAttributes)s).getResponseRpcHeaders()){
        if(h.getName().equals("log")){
            System.out.println("-- gathered logs --");
            System.out.print(h.getValue());
            System.out.println("----");
        }
    }

@takawitter takawitter reopened this Aug 5, 2015
@takawitter
Copy link
Member Author

Take hierarchical invocation of composite services into account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant