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

Defaults within device registration can cause JMS incompatibility #582

Open
DanielMaier-BSI opened this issue Apr 16, 2018 · 2 comments
Open

Comments

@DanielMaier-BSI
Copy link
Contributor

When a device gets registered with defaults, the keys of these defaults are freely choosable by the user. Hono protocol adapters use these defaults and adds them as AMQP application properties. However this might break JMS compatibility as there is no check or conversion of forbidden characters like '-'.

One way to prevent this would be to just document these restrictions. Another solution would be to replace forbidden characters or restrict allowed characters.

To be honest I am not convinced by any of the suggested solutions. Just documenting would not prevent from being used wrongly. It is likely that the user who creates the devices does not even know by which client the AMQP messages get consumed. Replacement might be non-transparent and annoying for use cases where no JMS gets used. The same applies for restricting allowed characters (Perhaps there are existing applications/frameworks that need a specific property key). Perhaps the appropriate place to replace the forbidden chars would be on JMS client side.

What do you think? Any better suggestions?

@pellmann
Copy link
Contributor

I would vote for documentation of this restriction in the Device Registration API and a checkDefaultsJMSCompatibility (something like that) config property with true as default in the base device registry implementation (which than prohibits such defaults).

@DanielMaier-BSI
Copy link
Contributor Author

Sounds reasonable from hono perspective for me.

In an environment where exist many tenants and device creators don't necessarily know if the northbound messages get consumed by JMS client, the only way would be to leave checkDefaultsJMSCompatibility configured with true. With this global configuration nobody would be able to set e.g. content-type as default property.

Another solution would be to "duplicate" default properties in AbstractProtocolAdapterBase and replace forbidden characters in one copy and perhaps prefix them somehow (similar to JMS vendor properties). With this solution only the developer of JMS based northbound application has to care about all this stuff. Of course hono needs to handle somehow now if somebody creates a default property with forbidden chars and the same property with replaced chars already.

@sophokles73 sophokles73 added this to the 1.0.0 milestone Apr 25, 2019
@sophokles73 sophokles73 removed this from the 1.0.0 milestone Oct 16, 2019
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

3 participants