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

Support for InputStreams in input #45

Open
syndesis-bot opened this issue Nov 15, 2017 · 7 comments
Open

Support for InputStreams in input #45

syndesis-bot opened this issue Nov 15, 2017 · 7 comments

Comments

@syndesis-bot
Copy link

@zregvart 2017-10-02 enhancement

Currently there is only support for String in the input of JSON and XML modules, we should support InputStream as input.

See XmlModule.java#L167-L171 and JsonModule.java#L145-L150.

When `InputStream` is specified in the input the following exception is thrown: ``` io.atlasmap.api.AtlasException: Unsupported input object type=io.atlasmap.json.v2.JsonComplexType at org.apache.camel.component.atlasmap.AtlasEndpoint.onExchange(AtlasEndpoint.java:209) at org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:71) at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:148) at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548) at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201) at org.apache.camel.processor.Pipeline.process(Pipeline.java:120) at org.apache.camel.processor.Pipeline.process(Pipeline.java:83) at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:110) at org.apache.camel.component.connector.ConnectorConsumerProcessor.process(ConnectorConsumerProcessor.java:66) at org.apache.camel.component.salesforce.SalesforceConsumer.processMessage(SalesforceConsumer.java:194) ... 35 common frames omitted ```
@syndesis-bot
Copy link
Author

@igarashitm 2017-10-02

Easy short term fix would be to rely on camel converters, so in camel-atlasmap do getBody(String.class) to make sure always putting String into atlasmap. If we really need stream for huge content handling, then we'll need to rewrite the JsonModule and XmlModule using stream based parser, JsonParser and SAX, instead of ObjectMapper and DOM currently using.

@syndesis-bot
Copy link
Author

@igarashitm 2017-10-02

Hmm that requires camel-atlasmap to look into source type and see if it's json/xml, which is dirty. So JsonModule/XmlModule should handle some type conversion anyway, which means we need to propagate the encoding of the stream as well.

@syndesis-bot
Copy link
Author

@igarashitm 2017-10-02

Changed my mind, right now it looks better to deserialize into String in camel-atlasmap if source is JSON/XML.

@syndesis-bot
Copy link
Author

@igarashitm 2017-10-02

Reserve this as a big enhancement to rewrite JsonModule and XmlModule to stream based. atlasmap-attic/camel-atlasmap#26 will address a short term fix.

mmelko pushed a commit to mmelko/atlasmap that referenced this issue Nov 20, 2017
mmelko pushed a commit to mmelko/atlasmap that referenced this issue Nov 20, 2017
mmelko pushed a commit to mmelko/atlasmap that referenced this issue Nov 20, 2017
@stale
Copy link

stale bot commented Aug 4, 2019

This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!

@stale stale bot added the status/stale Issue considered to be stale so that it can be closed soon label Aug 4, 2019
@igarashitm igarashitm removed the status/stale Issue considered to be stale so that it can be closed soon label Aug 4, 2019
@stale
Copy link

stale bot commented Nov 2, 2019

This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!

@stale stale bot added the status/stale Issue considered to be stale so that it can be closed soon label Nov 2, 2019
@stale stale bot removed the status/stale Issue considered to be stale so that it can be closed soon label Nov 4, 2019
@gashcrumb
Copy link
Collaborator

This is a sizable refactoring task and needs to be further broken down into concrete use cases, and probably split out into several issues.

@igarashitm igarashitm added the Epic label Oct 7, 2020
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