You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@avro.apache.org by Dave McAlpin <dm...@inome.com> on 2013/04/21 20:22:10 UTC
RE: Namespace issues when using schema with avdl file
Just fully qualify the data type, like this:
@namespace ("com.b2b.camel.service")
protocol CamelEndpointDAOService{
import schema "camelEndpoint.avsc";
int persist(com.b2b.camel.endpoint.CamelEndpoint camelEndpoint);
com.b2b.camel.endpoint.CamelEndpoint fetch(int id);
}
Dave
From: Atin Sood [mailto:soodatin@outlook.com]
Sent: Saturday, April 20, 2013 8:15 AM
To: user@avro.apache.org
Subject: Namespace issues when using schema with avdl file
I have a schema file like this
{"namespace" : "com.b2b.camel.endpoint",
"type" : "record",
"name" : "CamelEndpoint",
"fields" : [
{"name" : "id", "type" : "int"},
{"name" : "desc", "type" : "string"},
{"name" : "from", "type" : "string"},
{"name" : "to", "type" : "string"}
]
}
and I want to use the same in the the avdl file where my protocol will be using it
@namespace ("com.b2b.camel.service")
protocol CamelEndpointDAOService{
import schema "camelEndpoint.avsc";
int persist(CamelEndpoint);
CamelEndpoint fetch(int id);
}
Note that the camelEndpoint is in a different namespace compared to the CamelEndpointDAOService.
I am not sure how to make the avdl file look into the namespace of CamelEndpoint. I am importing the schema but not sure how to get the namespace correctly.
Regards
--
Atin Sood
Sent with Sparrow<http://www.sparrowmailapp.com/?sig>