You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Arnout Engelen (JIRA)" <ji...@apache.org> on 2012/12/04 23:18:58 UTC
[jira] [Created] (CAMEL-5847) Convert files or inputstreams
Arnout Engelen created CAMEL-5847:
-------------------------------------
Summary: Convert files or inputstreams
Key: CAMEL-5847
URL: https://issues.apache.org/jira/browse/CAMEL-5847
Project: Camel
Issue Type: Bug
Components: camel-mongodb
Reporter: Arnout Engelen
Inserting files into MongoDB doesn't work like this:
{code}
from("file:///tmp/test/apachecon?runLoggingLevel=TRACE")
.to("mongodb:connectionBean?database=x&collection=y&operation=insert");
{code}
It requires an explicit {{.convertBodyTo(String.class)}}.
The attached patch adds {{Converter}}s for File and InputStream object, detecting and supporting both {{JSON}} and {{BSON}} files/streams.
The {{new String(input, "utf-8"))}} fragment seems a bit dodgy, but I don't really see a better way.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CAMEL-5847) camel-mongodb - Add converters for
files or inputstreams
Posted by "Arnout Engelen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13510381#comment-13510381 ]
Arnout Engelen commented on CAMEL-5847:
---------------------------------------
Wow, thanks for the quick take-up!
> camel-mongodb - Add converters for files or inputstreams
> --------------------------------------------------------
>
> Key: CAMEL-5847
> URL: https://issues.apache.org/jira/browse/CAMEL-5847
> Project: Camel
> Issue Type: Improvement
> Components: camel-mongodb
> Affects Versions: 2.10.0
> Reporter: Arnout Engelen
> Assignee: Willem Jiang
> Fix For: 2.10.4, 2.11.0
>
> Attachments: mongodbconverters.diff
>
>
> Inserting files into MongoDB doesn't work like this:
> {code}
> from("file:///tmp/test/apachecon?runLoggingLevel=TRACE")
> .to("mongodb:connectionBean?database=x&collection=y&operation=insert");
> {code}
> It requires an explicit {{.convertBodyTo(String.class)}}.
> The attached patch adds {{Converter}}s for File and InputStream object, detecting and supporting both {{JSON}} and {{BSON}} files/streams.
> The {{new String(input, "utf-8"))}} fragment seems a bit dodgy, but I don't really see a better way.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CAMEL-5847) Convert files or inputstreams
Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13510342#comment-13510342 ]
Willem Jiang commented on CAMEL-5847:
-------------------------------------
@Arnout Thanks for your patch.
The convertor support to take the exchange as a parameter, we could leverage the exchange to find the charset name.
I will do some enhancement before applying the patch.
> Convert files or inputstreams
> -----------------------------
>
> Key: CAMEL-5847
> URL: https://issues.apache.org/jira/browse/CAMEL-5847
> Project: Camel
> Issue Type: Bug
> Components: camel-mongodb
> Reporter: Arnout Engelen
> Assignee: Willem Jiang
> Attachments: mongodbconverters.diff
>
>
> Inserting files into MongoDB doesn't work like this:
> {code}
> from("file:///tmp/test/apachecon?runLoggingLevel=TRACE")
> .to("mongodb:connectionBean?database=x&collection=y&operation=insert");
> {code}
> It requires an explicit {{.convertBodyTo(String.class)}}.
> The attached patch adds {{Converter}}s for File and InputStream object, detecting and supporting both {{JSON}} and {{BSON}} files/streams.
> The {{new String(input, "utf-8"))}} fragment seems a bit dodgy, but I don't really see a better way.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CAMEL-5847) camel-mongodb - Add converters for
files or inputstreams
Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13510365#comment-13510365 ]
Willem Jiang commented on CAMEL-5847:
-------------------------------------
Applied the patch with thanks to Arnout. I changed the code to use IOConverter from camel-core to avoid introducing the dependency of common-io.
> camel-mongodb - Add converters for files or inputstreams
> --------------------------------------------------------
>
> Key: CAMEL-5847
> URL: https://issues.apache.org/jira/browse/CAMEL-5847
> Project: Camel
> Issue Type: Improvement
> Components: camel-mongodb
> Affects Versions: 2.10.0
> Reporter: Arnout Engelen
> Assignee: Willem Jiang
> Fix For: 2.10.4, 2.11.0
>
> Attachments: mongodbconverters.diff
>
>
> Inserting files into MongoDB doesn't work like this:
> {code}
> from("file:///tmp/test/apachecon?runLoggingLevel=TRACE")
> .to("mongodb:connectionBean?database=x&collection=y&operation=insert");
> {code}
> It requires an explicit {{.convertBodyTo(String.class)}}.
> The attached patch adds {{Converter}}s for File and InputStream object, detecting and supporting both {{JSON}} and {{BSON}} files/streams.
> The {{new String(input, "utf-8"))}} fragment seems a bit dodgy, but I don't really see a better way.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (CAMEL-5847) Convert files or inputstreams
Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5847?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Willem Jiang reassigned CAMEL-5847:
-----------------------------------
Assignee: Willem Jiang
> Convert files or inputstreams
> -----------------------------
>
> Key: CAMEL-5847
> URL: https://issues.apache.org/jira/browse/CAMEL-5847
> Project: Camel
> Issue Type: Bug
> Components: camel-mongodb
> Reporter: Arnout Engelen
> Assignee: Willem Jiang
> Attachments: mongodbconverters.diff
>
>
> Inserting files into MongoDB doesn't work like this:
> {code}
> from("file:///tmp/test/apachecon?runLoggingLevel=TRACE")
> .to("mongodb:connectionBean?database=x&collection=y&operation=insert");
> {code}
> It requires an explicit {{.convertBodyTo(String.class)}}.
> The attached patch adds {{Converter}}s for File and InputStream object, detecting and supporting both {{JSON}} and {{BSON}} files/streams.
> The {{new String(input, "utf-8"))}} fragment seems a bit dodgy, but I don't really see a better way.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CAMEL-5847) Convert files or inputstreams
Posted by "Arnout Engelen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5847?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Arnout Engelen updated CAMEL-5847:
----------------------------------
Attachment: mongodbconverters.diff
> Convert files or inputstreams
> -----------------------------
>
> Key: CAMEL-5847
> URL: https://issues.apache.org/jira/browse/CAMEL-5847
> Project: Camel
> Issue Type: Bug
> Components: camel-mongodb
> Reporter: Arnout Engelen
> Attachments: mongodbconverters.diff
>
>
> Inserting files into MongoDB doesn't work like this:
> {code}
> from("file:///tmp/test/apachecon?runLoggingLevel=TRACE")
> .to("mongodb:connectionBean?database=x&collection=y&operation=insert");
> {code}
> It requires an explicit {{.convertBodyTo(String.class)}}.
> The attached patch adds {{Converter}}s for File and InputStream object, detecting and supporting both {{JSON}} and {{BSON}} files/streams.
> The {{new String(input, "utf-8"))}} fragment seems a bit dodgy, but I don't really see a better way.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (CAMEL-5847) camel-mongodb - Add converters for
files or inputstreams
Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5847?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Willem Jiang resolved CAMEL-5847.
---------------------------------
Resolution: Fixed
Applied the patch into trunk and camel-2.10.x branches.
> camel-mongodb - Add converters for files or inputstreams
> --------------------------------------------------------
>
> Key: CAMEL-5847
> URL: https://issues.apache.org/jira/browse/CAMEL-5847
> Project: Camel
> Issue Type: Improvement
> Components: camel-mongodb
> Affects Versions: 2.10.0
> Reporter: Arnout Engelen
> Assignee: Willem Jiang
> Fix For: 2.10.4, 2.11.0
>
> Attachments: mongodbconverters.diff
>
>
> Inserting files into MongoDB doesn't work like this:
> {code}
> from("file:///tmp/test/apachecon?runLoggingLevel=TRACE")
> .to("mongodb:connectionBean?database=x&collection=y&operation=insert");
> {code}
> It requires an explicit {{.convertBodyTo(String.class)}}.
> The attached patch adds {{Converter}}s for File and InputStream object, detecting and supporting both {{JSON}} and {{BSON}} files/streams.
> The {{new String(input, "utf-8"))}} fragment seems a bit dodgy, but I don't really see a better way.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CAMEL-5847) camel-mongodb - Add converters for
files or inputstreams
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5847?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen updated CAMEL-5847:
-------------------------------
Affects Version/s: 2.10.0
Fix Version/s: 2.11.0
2.10.4
Issue Type: Improvement (was: Bug)
Summary: camel-mongodb - Add converters for files or inputstreams (was: Convert files or inputstreams)
This is not a bug, and also added a better description in summary
> camel-mongodb - Add converters for files or inputstreams
> --------------------------------------------------------
>
> Key: CAMEL-5847
> URL: https://issues.apache.org/jira/browse/CAMEL-5847
> Project: Camel
> Issue Type: Improvement
> Components: camel-mongodb
> Affects Versions: 2.10.0
> Reporter: Arnout Engelen
> Assignee: Willem Jiang
> Fix For: 2.10.4, 2.11.0
>
> Attachments: mongodbconverters.diff
>
>
> Inserting files into MongoDB doesn't work like this:
> {code}
> from("file:///tmp/test/apachecon?runLoggingLevel=TRACE")
> .to("mongodb:connectionBean?database=x&collection=y&operation=insert");
> {code}
> It requires an explicit {{.convertBodyTo(String.class)}}.
> The attached patch adds {{Converter}}s for File and InputStream object, detecting and supporting both {{JSON}} and {{BSON}} files/streams.
> The {{new String(input, "utf-8"))}} fragment seems a bit dodgy, but I don't really see a better way.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira