LTI Message Handler and Resource Handlers

LTI Message Handler and Resource Handlers

I am confused about some of the specifics around Singleton Message Handlers vs. Resource Handlers. If a singleton message handler is specified, can resource handlers be specified? I assume not since this wouldn't make sense, but there doesn't seem to be anything restricting that from occurring. If it does occur, I also assume that the singleton message handler should be preferred (over, for example, a more specific resource handler).

Also, can we specify route parameters for the path of a message handler? I see what appears to be route parameters in sections 5.1.6 and 10.2 and Appendix E where the name of the parameter is wrapped in curly brackets, but I see no mention of required support or a formal explanation of how to parse route parameters.

Finally, is there anyway for the TP to determine what resource type the TC used to generate the launch request to the TP? For example, given several resource types, all that link to the same endpoint, how would the TP know what resource handler was used to form the launch request? I ask not because I plan on having a single endpoint, but rather because I would rather not scan through the list of resource handlers and find the first one to the specific path to which the request was made. That method doesn't seem fool-proof since theoretically other resource handlers could route to the same exact path.

StephenVickers's picture

Re: LTI Message Handler and Resource Handlers

Yes you can specify both singleton messages and resource messages.  The former should be used for messages which are not associated with a specific tool (resource), such as the ToolProxyRegistrationMessage.  Any message associated with a tool should be declared within a resource handler.

The placeholders in the endpoint element of a service definition are for illustrative purposes only - parseable templates for service endpoints will be introduced in LTI 2.1.

If you want to use the same endpoint for all resources, then you could use an additional path element, a query parameter or a custom parameter to indicate which resource is being launched.