avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arturo Candela <fri...@gmail.com>
Subject Re: Howto return an method error defined on the json.
Date Tue, 07 Mar 2017 11:18:23 GMT
Hi Everybody.

I'm getting a problem in the java client, instead of getting the
AvroRemoteExcetiption, I'm getting an AvroRuntimeException.

In the .net Server rpc part, I launch a ServerError (As defined on the json
structure) but in the java client, I got an "AvroRuntimeException"

The SpecificRequestor.java path is:
  public Exception readError(Schema writer, Schema reader, Decoder in)
    throws IOException {
    Object value = getDatumReader(writer, reader).read(null, in);
    if (value instanceof Exception)
      return (Exception)value;
    return new AvroRuntimeException(value.toString());

The problem is that result of getDatumReader is a string instead of the
exception object. Both schemas are "string"

I think the avro framework doesn't know my remote exception but I don't
know why.

Could you help me please?


El lun., 6 mar. 2017 a las 17:48, Arturo Candela (<frisix@gmail.com>)


I've found the problem, it was my fault.

Since Avro uses reflection, the unhandled exceptions by user code are
threated by the debugger as "code" problems. So, if you disable the debug
options: "Enable Just My Code" the debuging works.



El lun., 6 mar. 2017 a las 17:13, Arturo Candela (<frisix@gmail.com>)

Hi guys.

I'm trying to implement the avro rpc 1.7.7 using a rabbitmq queue. I've
more or less a version working and a java client can run remote remote
methods and a c# server is who executes the method and returns the response
to the client.

I'm not able to return an error defined on the protocol, For example, If I
have a mail server with the method send and an error which is called
"ServerError", when I throw that error the server crashes because and
unhandled exception, That is because I don't catch it.

What I would like to know if there is another way to return the exception
to the client or assure that I have a problem in my current implement

Thank you in advance,


View raw message