[ 
https://issues.apache.org/jira/browse/CAMEL-13988?focusedWorklogId=320336&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-320336
 ]

ASF GitHub Bot logged work on CAMEL-13988:
------------------------------------------

                Author: ASF GitHub Bot
            Created on: 30/Sep/19 03:43
            Start Date: 30/Sep/19 03:43
    Worklog Time Spent: 10m 
      Work Description: davsclaus commented on pull request #3206: CAMEL-13988: 
Add Map data input support to Protobuf dataformat
URL: https://github.com/apache/camel/pull/3206
 
 
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

            Worklog Id:     (was: 320336)
    Remaining Estimate: 0h
            Time Spent: 10m

> Enable camel-protobuf to marshal from objects of type Map to Proto using the 
> message descriptor
> -----------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-13988
>                 URL: https://issues.apache.org/jira/browse/CAMEL-13988
>             Project: Camel
>          Issue Type: New Feature
>    Affects Versions: 3.0.0.RC1
>            Reporter: Omar Al-Safi
>            Assignee: Omar Al-Safi
>            Priority: Minor
>             Fix For: 3.x
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Currently, when you marshal using camel-protobuf, it expects beforehand that 
> you have already created your protobuf message as you can see 
> [here|https://github.com/apache/camel/blob/master/components/camel-protobuf/src/main/java/org/apache/camel/dataformat/protobuf/ProtobufDataFormat.java#L129].
>  I think is beneficial if the user can marshal the data automatically to 
> protobuf provided he/she has the data in {{Map}} type and with the correct 
> instance class name is provided. We can achieve this with the following steps:
>  # In {{marshal}} method, we check if the graph object of type {{Map.class}}.
>  # If it is of type {{Map.class}}, then using the 
> {{defaultInstance.getDescriptorForType()}}, we obtain the [Message 
> Descriptor|https://developers.google.com/protocol-buffers/docs/reference/java/com/google/protobuf/Descriptors.Descriptor]
>  for the class instance.
>  # Using the obtained descriptor, we iterate over map value and set the field 
> from the descriptor.
> By using this, the user can marshal data to Protobuf without the need to 
> process it before as long he/she has the data in type {{Map}}. I can send a 
> PoC PR if you guys find my proposal reasonable enough but from my the top of 
> my head, it shouldn't be much of work to add this feature to camel-protobuf



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to