Re: Connecting to NOTIFY with telnet

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Igal Sapir <igal(at)lucee(dot)org>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Connecting to NOTIFY with telnet
Date: 2019-05-04 18:34:08
Message-ID: CAMkU=1zHwRenmC51quR2gnrFftGW5mKGQxvx+03YekqANCB4Bg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, May 4, 2019 at 1:49 PM Igal Sapir <igal(at)lucee(dot)org> wrote:

> Christoph,
>
> On Sat, May 4, 2019 at 10:44 AM Christoph Moench-Tegeder <
> cmt(at)burggraben(dot)net> wrote:
>
>> ## Igal Sapir (igal(at)lucee(dot)org):
>>
>> > My main "issue" is that the official pgjdbc driver does not support the
>> > notifications with listen and I was trying to figure out why.
>>
>> https://jdbc.postgresql.org/documentation/head/listennotify.html
>>
>>
> I should have been more explicit. My main issue is with the following
> statement from the link that you posted:
>
> > A key limitation of the JDBC driver is that it cannot receive
> asynchronous notifications and must poll the backend to check if any
> notifications were issued
>
> Polling is much less efficient than event handling and I'm sure that
> there's a major performance hit with that.
>

Isn't that addressed here?:

// If this thread is the only one that uses the connection,
a timeout can be used to
// receive notifications immediately:
// org.postgresql.PGNotification notifications[] =
pgconn.getNotifications(10000);

Cheers,

Jeff

>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Igal Sapir 2019-05-04 19:03:48 Re: Connecting to NOTIFY with telnet
Previous Message Igal Sapir 2019-05-04 17:49:04 Re: Connecting to NOTIFY with telnet