There is not a built-in way to do this.  I recommend creating a registry
object -- similar to ExtensionRegistry -- in which you can register all the
types you need to handle.  Then you can register the types in high-level
code and pass that down to the RPC system, which itself then won't need to
know what types it is handling.
Note that every message type has a "default instance" which can also serve
as a factory for the type.  So basically, your registry will just be a
Map<String, Message>, where the messages are the default instances that you
get from calling MessageType.getDefaultInstance().  You can call
defaultInstance.newBuilderForType() to create a new builder.

On Tue, Jun 2, 2009 at 3:10 AM, <luis.gasc...@gmail.com> wrote:

>
> Hi,
>
> I am using PB as a payload for AMQP messages. The same queue will get
> different types of PB Messages. Right now, I am using the "type" AMQP
> header field to write the full name of the message as returned by
> msg.getDescriptorForType().getFullName().
>
> Is there any way get a Builder from getFullName(), so that I can parse
> all diferrent PB Messages using a single queue ?
>
> Thanks
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to