mp-custom-healthcheck example review

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

mp-custom-healthcheck example review

Cesar Hernandez
Hi list,

Currently, we have a nice example for mp-custom-healthcheck but digging
into the tests, it seems the tests depends on an online service from
http://api.openweathermap.org/data/2.5/
https://github.com/apache/tomee/blob/master/examples/mp-custom-healthcheck/src/test/java/org/superbiz/test/WeatherServiceTest.java#L74

My two cents about this dependency is that it can produce at some point
failing builds in our CI if the api.openweathermap.org is on mantainacne or
there is some kind of dns isssue.
My proposal is to:
1) Create a ticket to describe the problem
2) Include in the ticket a high-level alternative to don't depend on a
third party endpoint. For example haveing two endpoints within the
exzample, one alwasy resturning 200 and another one returning always a 401
or any other != 200 http response code.

What do you think?

--
Atentamente:
César Hernández.
Reply | Threaded
Open this post in threaded view
|

Re: mp-custom-healthcheck example review

Cesar Hernandez
Disregard my previous email, looking more closely to the code it seems the
example include a mock version of the real endpoint
https://github.com/apache/tomee/blob/master/examples/mp-custom-healthcheck/src/main/java/org/superbiz/WeatherServiceHealthCheck.java#L39

El vie., 28 jun. 2019 a las 11:47, Cesar Hernandez (<[hidden email]>)
escribió:

> Hi list,
>
> Currently, we have a nice example for mp-custom-healthcheck but digging
> into the tests, it seems the tests depends on an online service from
> http://api.openweathermap.org/data/2.5/
>
> https://github.com/apache/tomee/blob/master/examples/mp-custom-healthcheck/src/test/java/org/superbiz/test/WeatherServiceTest.java#L74
>
> My two cents about this dependency is that it can produce at some point
> failing builds in our CI if the api.openweathermap.org is on mantainacne
> or there is some kind of dns isssue.
> My proposal is to:
> 1) Create a ticket to describe the problem
> 2) Include in the ticket a high-level alternative to don't depend on a
> third party endpoint. For example haveing two endpoints within the
> exzample, one alwasy resturning 200 and another one returning always a 401
> or any other != 200 http response code.
>
> What do you think?
>
> --
> Atentamente:
> César Hernández.
>


--
Atentamente:
César Hernández.
Reply | Threaded
Open this post in threaded view
|

Re: mp-custom-healthcheck example review

David Salter-4
In reply to this post by Cesar Hernandez
Hi Cesar,

That sounds a sensible approach to me. It would make the test more
predictable and less likely to fail due to external situations.

I think writing an included “simple” weather service that just returns 200
or 40x would improve the sample.

Thanks

David.

On Fri, 28 Jun 2019 at 18:47, Cesar Hernandez <[hidden email]> wrote:

> Hi list,
>
> Currently, we have a nice example for mp-custom-healthcheck but digging
> into the tests, it seems the tests depends on an online service from
> http://api.openweathermap.org/data/2.5/
>
> https://github.com/apache/tomee/blob/master/examples/mp-custom-healthcheck/src/test/java/org/superbiz/test/WeatherServiceTest.java#L74
>
> My two cents about this dependency is that it can produce at some point
> failing builds in our CI if the api.openweathermap.org is on mantainacne
> or
> there is some kind of dns isssue.
> My proposal is to:
> 1) Create a ticket to describe the problem
> 2) Include in the ticket a high-level alternative to don't depend on a
> third party endpoint. For example haveing two endpoints within the
> exzample, one alwasy resturning 200 and another one returning always a 401
> or any other != 200 http response code.
>
> What do you think?
>
> --
> Atentamente:
> César Hernández.
>
Reply | Threaded
Open this post in threaded view
|

Re: mp-custom-healthcheck example review

David Salter-4
In reply to this post by Cesar Hernandez
Lol. Sounds like someone has already done what we’re talking about :)

David.

On Fri, 28 Jun 2019 at 18:53, Cesar Hernandez <[hidden email]> wrote:

> Disregard my previous email, looking more closely to the code it seems the
> example include a mock version of the real endpoint
>
> https://github.com/apache/tomee/blob/master/examples/mp-custom-healthcheck/src/main/java/org/superbiz/WeatherServiceHealthCheck.java#L39
>
> El vie., 28 jun. 2019 a las 11:47, Cesar Hernandez (<[hidden email]
> >)
> escribió:
>
> > Hi list,
> >
> > Currently, we have a nice example for mp-custom-healthcheck but digging
> > into the tests, it seems the tests depends on an online service from
> > http://api.openweathermap.org/data/2.5/
> >
> >
> https://github.com/apache/tomee/blob/master/examples/mp-custom-healthcheck/src/test/java/org/superbiz/test/WeatherServiceTest.java#L74
> >
> > My two cents about this dependency is that it can produce at some point
> > failing builds in our CI if the api.openweathermap.org is on mantainacne
> > or there is some kind of dns isssue.
> > My proposal is to:
> > 1) Create a ticket to describe the problem
> > 2) Include in the ticket a high-level alternative to don't depend on a
> > third party endpoint. For example haveing two endpoints within the
> > exzample, one alwasy resturning 200 and another one returning always a
> 401
> > or any other != 200 http response code.
> >
> > What do you think?
> >
> > --
> > Atentamente:
> > César Hernández.
> >
>
>
> --
> Atentamente:
> César Hernández.
>
Reply | Threaded
Open this post in threaded view
|

Re: mp-custom-healthcheck example review

Jose Henrique Ventura
Hi guys,

Is all good with that example?
and yes, I used the openweathermap url just to give an idea of how it can be used.

I can help to improved the example if needed. =)


Best Regards,
José Henrique Ventura.


Sent with ProtonMail Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Friday, June 28, 2019 6:58 PM, David Salter <[hidden email]> wrote:

> Lol. Sounds like someone has already done what we’re talking about :)
>
> David.
>
> On Fri, 28 Jun 2019 at 18:53, Cesar Hernandez [hidden email] wrote:
>
> > Disregard my previous email, looking more closely to the code it seems the
> > example include a mock version of the real endpoint
> > https://github.com/apache/tomee/blob/master/examples/mp-custom-healthcheck/src/main/java/org/superbiz/WeatherServiceHealthCheck.java#L39
> > El vie., 28 jun. 2019 a las 11:47, Cesar Hernandez (<[hidden email]
> >
> > > )
> > > escribió:
> >
> > > Hi list,
> > > Currently, we have a nice example for mp-custom-healthcheck but digging
> > > into the tests, it seems the tests depends on an online service from
> > > http://api.openweathermap.org/data/2.5/
> >
> > https://github.com/apache/tomee/blob/master/examples/mp-custom-healthcheck/src/test/java/org/superbiz/test/WeatherServiceTest.java#L74
> >
> > > My two cents about this dependency is that it can produce at some point
> > > failing builds in our CI if the api.openweathermap.org is on mantainacne
> > > or there is some kind of dns isssue.
> > > My proposal is to:
> > >
> > > 1.  Create a ticket to describe the problem
> > > 2.  Include in the ticket a high-level alternative to don't depend on a
> > >     third party endpoint. For example haveing two endpoints within the
> > >     exzample, one alwasy resturning 200 and another one returning always a
> > >     401
> > >     or any other != 200 http response code.
> > >
> > >
> > > What do you think?
> > > --
> > > Atentamente:
> > > César Hernández.
> >
> > --
> > Atentamente:
> > César Hernández.


Reply | Threaded
Open this post in threaded view
|

Re: mp-custom-healthcheck example review

Cesar Hernandez
Hi Jose,
The example is great!
It was my mistake to not fully navigate the sourcecode to understand that
the endpoint as part of the application and not the one from the internet.

By looking at the example, I think instead of modifying the existing one,
more examples can be created for interesting scenarios like monitoring DB,
ActiveMQ broker or other third-party resources TomEE users use. Also some
Operating System classics like "To many open Files" or "full hard disk" ;).
Again, this is just an idea outside of the scope of the current example ;)

El dom., 30 jun. 2019 a las 14:04, Jose Henrique Ventura
(<[hidden email]>) escribió:

> Hi guys,
>
> Is all good with that example?
> and yes, I used the openweathermap url just to give an idea of how it can
> be used.
>
> I can help to improved the example if needed. =)
>
>
> Best Regards,
> José Henrique Ventura.
>
>
> Sent with ProtonMail Secure Email.
>
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> On Friday, June 28, 2019 6:58 PM, David Salter <[hidden email]>
> wrote:
>
> > Lol. Sounds like someone has already done what we’re talking about :)
> >
> > David.
> >
> > On Fri, 28 Jun 2019 at 18:53, Cesar Hernandez [hidden email]
> wrote:
> >
> > > Disregard my previous email, looking more closely to the code it seems
> the
> > > example include a mock version of the real endpoint
> > >
> https://github.com/apache/tomee/blob/master/examples/mp-custom-healthcheck/src/main/java/org/superbiz/WeatherServiceHealthCheck.java#L39
> > > El vie., 28 jun. 2019 a las 11:47, Cesar Hernandez (<
> [hidden email]
> > >
> > > > )
> > > > escribió:
> > >
> > > > Hi list,
> > > > Currently, we have a nice example for mp-custom-healthcheck but
> digging
> > > > into the tests, it seems the tests depends on an online service from
> > > > http://api.openweathermap.org/data/2.5/
> > >
> > >
> https://github.com/apache/tomee/blob/master/examples/mp-custom-healthcheck/src/test/java/org/superbiz/test/WeatherServiceTest.java#L74
> > >
> > > > My two cents about this dependency is that it can produce at some
> point
> > > > failing builds in our CI if the api.openweathermap.org is on
> mantainacne
> > > > or there is some kind of dns isssue.
> > > > My proposal is to:
> > > >
> > > > 1.  Create a ticket to describe the problem
> > > > 2.  Include in the ticket a high-level alternative to don't depend
> on a
> > > >     third party endpoint. For example haveing two endpoints within
> the
> > > >     exzample, one alwasy resturning 200 and another one returning
> always a
> > > >     401
> > > >     or any other != 200 http response code.
> > > >
> > > >
> > > > What do you think?
> > > > --
> > > > Atentamente:
> > > > César Hernández.
> > >
> > > --
> > > Atentamente:
> > > César Hernández.
>
>
>

--
Atentamente:
César Hernández.