You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flume.apache.org by terrey shih <te...@gmail.com> on 2014/10/09 19:38:14 UTC
does flume send event in a multi threaded manner ?
Hi
Can sending an event gets blocked because something happened down at the
source of the other agent?
For example, consider the following taken from the developer guide.
public void myMethod(){
SomeDataObject data = getData()
Event event = EventBuilder.withBody(data);
// Send the event
try {
client.append(event);
} catch (EventDeliveryException e) {
// clean up and recreate the client
client.close();
client = null;
client = RpcClientFactory.getDefaultInstance(hostname, port);
}
}
if for some reason, the event has problem sending downstream, would it
block myMethod from returning ?
I know the catch block might catch the exception, but is it possible that
something else happens and the method just hangs and myMethod never returns
? Or is it multithreaded and does not block ?
thx,
Terrey
Re: does flume send event in a multi threaded manner ?
Posted by terrey shih <te...@gmail.com>.
thanks Har. How long does it wait for return or throw the excepion ?
thx
On Thu, Oct 9, 2014 at 10:51 AM, Hari Shreedharan <hshreedharan@cloudera.com
> wrote:
> The method does block, but it would not block forever. It will either
> return or throw.
>
> Thanks,
> Hari
>
>
> On Thu, Oct 9, 2014 at 10:38 AM, terrey shih <te...@gmail.com> wrote:
>
>> Hi
>>
>> Can sending an event gets blocked because something happened down at the
>> source of the other agent?
>>
>> For example, consider the following taken from the developer guide.
>>
>> public void myMethod(){
>>
>>
>> SomeDataObject data = getData()
>> Event event = EventBuilder.withBody(data);
>>
>> // Send the event
>> try {
>> client.append(event);
>> } catch (EventDeliveryException e) {
>> // clean up and recreate the client
>> client.close();
>> client = null;
>> client = RpcClientFactory.getDefaultInstance(hostname, port);
>> }
>>
>>
>> }
>>
>> if for some reason, the event has problem sending downstream, would it
>> block myMethod from returning ?
>>
>> I know the catch block might catch the exception, but is it possible that
>> something else happens and the method just hangs and myMethod never returns
>> ? Or is it multithreaded and does not block ?
>>
>> thx,
>> Terrey
>>
>>
>>
>>
>
Re: does flume send event in a multi threaded manner ?
Posted by Hari Shreedharan <hs...@cloudera.com>.
The method does block, but it would not block forever. It will either return or throw.
Thanks,
Hari
On Thu, Oct 9, 2014 at 10:38 AM, terrey shih <te...@gmail.com> wrote:
> Hi
> Can sending an event gets blocked because something happened down at the
> source of the other agent?
> For example, consider the following taken from the developer guide.
> public void myMethod(){
> SomeDataObject data = getData()
> Event event = EventBuilder.withBody(data);
> // Send the event
> try {
> client.append(event);
> } catch (EventDeliveryException e) {
> // clean up and recreate the client
> client.close();
> client = null;
> client = RpcClientFactory.getDefaultInstance(hostname, port);
> }
> }
> if for some reason, the event has problem sending downstream, would it
> block myMethod from returning ?
> I know the catch block might catch the exception, but is it possible that
> something else happens and the method just hangs and myMethod never returns
> ? Or is it multithreaded and does not block ?
> thx,
> Terrey