Re: Dropwizard GELF support

2016-05-06 Thread Steve Kradel
This is probably outside the scope of what dropwizard should provide; see https://github.com/skradel/logentries-dropwizard for an example of adding a custom appender factory. -- You received this message because you are subscribed to the Google Groups "dropwizard-user" group. To unsubscribe fr

Re: How long for deploy startup/stop time

2016-05-27 Thread Steve Kradel
In my experience about five seconds is doable for a _moderately_ complex startup, with more time-consuming initialization pushed off to a ScheduledExecutor. On Friday, May 27, 2016 at 12:05:55 AM UTC-4, Ryan Kennedy wrote: > > That depends a lot on how you've configured your server and what Mana

Re: Any Success Stories ?

2016-09-07 Thread Steve Kradel
Your questions would appear to have nothing to do with Dropwizard per se. -- You received this message because you are subscribed to the Google Groups "dropwizard-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to dropwizard-user+unsubscr...@googlegr

Re: Jetty shuts down automatically after some time

2016-09-07 Thread Steve Kradel
What is your service doing? I haven't seen anything to suggest an intrinsic problem in the framework across millions of requests. [centos@x ~]$ systemctl status dwx *●* dwx.service - dwx Loaded: loaded (/etc/systemd/system/dwx.service; enabled; vendor preset: disabled) Active: *act

Re: Lack of CDI?

2016-10-10 Thread Steve Kradel
I agree with your take on this; the example cases are not really suitable for projects of greater complexity. My own approach is to load a Spring ApplicationContext, wrap it in a Dropwizard Managed instance for graceful shutdown, and pull from that Spring context various JAX-RS resources, filte

Re: Redirecting from an UnauthorizedHandler

2016-11-22 Thread Steve Kradel
My understanding of the way this ought to work... 1) First failing AuthFilter throws a WebApplicationException; delegating to its UnauthorizedHandler construction of the Response 2) Last(??) matched ExceptionMapper finalizes the response to the client (maybe--documentation on Jersey ExceptionMap

Re: Using Sessions from AuthFitler

2017-02-12 Thread Steve Kradel
Instead of trying to use sessions, I'd advise adding the email property to your User type, and simply populate it in the auth filter as part of verifying the OAuth token. Or you could add it as a request property, but this seems much more cumbersome than tacking it onto the user/principal. In

Re: 'Socket not created by this factory' with DW v1.1.0

2017-03-29 Thread Steve Kradel
This wouldn't be related to DW validation--rather, the AWS S3 API has somehow ended up with a handle to a Socket which is not an SSLSocket. Intuition suggests that DW 1.1 may have introduced a change that interferes with some global / default state in Apache HTTPClient. It would be useful to kn

Re: How to log exception of Unable to process JSON in dropwizard

2017-03-30 Thread Steve Kradel
Yes: suppress the default exception mapper, and provide one like this (in this case we tell the client what it did wrong, but you could log instead or in addition to): import java.util.LinkedHashMap; import java.util.Map; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Res

Re: Dropwizard upgrade (1.+) Date serialization no longer a long

2017-05-12 Thread Steve Kradel
Are you sure a java.sql.Date or similar hasn't gotten its way into the works? -MM-dd is the default serialization format for java.sql.Date, but a java.util.Date remains very much a wrapper around a long int. On Friday, May 12, 2017 at 11:08:38 AM UTC-4, Gemma Cabero Colmenero wrote: > > Hi,

Re: How to return JSON response when HTTP-result-code != 200 ...

2017-05-22 Thread Steve Kradel
Unless there is some more subtle problem at play here, most likely the issue is with the approach you're using to read the response body (i.e., using a high-level client layer that throws an exception if it doesn't get a successful status code and/or the content-type it expected). Certainly th

Re: Using Dropwizard Client with mutual authentication

2017-06-15 Thread Steve Kradel
I haven't checked if Dropwizard Client yet makes this entirely painless or to what extent, but this should get you headed in the right direction: https://developer.okta.com/blog/2015/12/02/tls-client-authentication-for-services FWIW I've written a server-side Dropwizard authenticator for client

Re: Problem with detecting application failure when native threads are exhausted

2017-07-13 Thread Steve Kradel
Is Dropwizard trying to create a new thread related to the exception, or is your application code? Can you retrieve Dropwizard's metrics from the admin service, and if so, are they informative? A health check is going to be tricky (things are bound to stop working unpredictably on OOM). Perha

Re: Pitfalls for long-running parallel requests?

2017-07-20 Thread Steve Kradel
There are a lot of things that might hamper concurrency in this scenario, but it's unlikely they have anything specific to do with Dropwizard (or Jetty). Some things to consider: - what data source / connection provider / connection pool manager are you using? is it tuned to accommodate very l

Re: Pitfalls for long-running parallel requests?

2017-07-20 Thread Steve Kradel
Hi Kristian, It sounds like something outside of the test resource+method shown is blocking the requests. Maybe the filter itself? What does the bootstrap config (YAML) look like--perhaps some nonstandard options appeared while grappling with inherently slow requests? Is this running on a "n

Re: Jersey filter in Dropwizard to set some global FreeMarker variables

2017-08-25 Thread Steve Kradel
This is probably not an appropriate occasion to use a Jersey filter, nor is it a prudent way to use global Freemarker variables; consider moving the population of these fields to your View concrete class. Alternately you could extend Dropwizard's Freemarker view engine to assign some variables

Re: Filter class not getting executed

2017-09-24 Thread Steve Kradel
Is your filter implementation (plus any others) calling chain.doFilter( request, response) at the end of its own doFilter? The servlet filter registration looks OK and is likely not the source of the trouble. On Sunday, September 24, 2017 at 8:12:15 AM UTC-4, SUDHA JENSLIN wrote: > > Adding dro

Re: Swagger with Dropwizard

2017-10-10 Thread Steve Kradel
Just add "@ApiParam(hidden=true)" to your @Auth parameter to get Swagger to understand it's not a request entity class. On Monday, October 9, 2017 at 4:19:20 AM UTC-4, Piyush Mendhiratta wrote: > > I am trying to create swagger using the swaggerUI. My API framework uses > dropwizard. Now when I

Re: Creating JSON web tokens from endpoint that uses Basic Auth?

2017-11-02 Thread Steve Kradel
Add some logging statements to your code... either your basic authenticator isn't getting called (because the request included no credentials) or authentication was unsuccessful. There is no standard for deciding how to issue a JWT/JWS--you could frontend it with oauth, SSL client certificate a

Re: SLF4J Warning - Loggers will not work as they were created during initialization phase

2018-01-15 Thread Steve Kradel
I suspect you will need Dropwizard >= 1.2.0 for looser coupling between DW and logging initialization. See: https://github.com/dropwizard/dropwizard/pull/1900 On Monday, January 15, 2018 at 2:17:06 PM UTC-5, tuk wrote: > > Crossposting from stackoverflow >

Re: How can I dynamically re-establish a datasource?

2018-02-01 Thread Steve Kradel
Generally, the best bet is to adopt a pooling/validating datasource like HikariCP. Not familiar with FCF but it sounds like a vendor-specific feature that might be supported by the JDBC driver. Managed objects are for startup and cleanup tied to the lifecycle of the Dropwizard application, not

Re: How can I dynamically re-establish a datasource?

2018-02-02 Thread Steve Kradel
sitant to > go down that road. > > Do you now whether or not database connections can be assigned at any > point other than during startup when the run() method is called? > > On Thursday, February 1, 2018 at 2:06:10 PM UTC-6, Steve Kradel wrote: >> >> Genera

Re: Dropwizard response time is slow for first request

2018-02-07 Thread Steve Kradel
You could add logging to the resource constructor to check timestamps, for one. Consider a connection pool to keep at least a few "hot" connections ready to go, whether those are connections to a database, HTTPS endpoint, or other systems. Consider registering resource classes as eagerly-init

Re: Double slashes in log

2018-02-20 Thread Steve Kradel
Your code looks correct; the resource path appears to be bugged in 1.3.0-rc6 but not in 1.2.0. On Tuesday, February 20, 2018 at 7:37:44 AM UTC-5, Thomas Sundberg wrote: > > Hi! > > Here is an example showing the logging I mentioned: > > https://github.com/tsundberg/dropwizard-broken-startup-log

Re: Fatal Error starting dropwizard with a Java8 LocalDate PathParam

2018-02-21 Thread Steve Kradel
Have you tried io.dropwizard.jersey.jsr310.LocalDateParam instead? Jersey / JAX-RS parameter matching and Jackson / JSON serialization are pretty much separate facilities. On Wednesday, February 21, 2018 at 1:30:41 PM UTC-5, Shannon wrote: > > I get the following fatal error starting my dropwiza

Re: Shiro Dropwizard returns HTTP 401 unauthorized error

2018-05-20 Thread Steve Kradel
How do you imagine Apache Shiro hooks into the Dropwizard request lifecycle? Have you reviewed Dropwizard's authentication documentation? In general, this sort of post is unlikely to receive many useful responses, because it requires knowing about both Dropwizard and Shiro. If DW has been con

Re: Accessing @Auth Principals in dropwizard-client.

2018-10-25 Thread Steve Kradel
You'll want to register a filter on the Dropwizard/Jersey Client object (not environment.jersey() which is the "server"). Actually tracking the client's security context can be a little tricky--use a ThreadLocal as you mentioned, or, to preserve sanity in potentially async/multithreaded cases,

Re: Accessing @Auth Principals in dropwizard-client.

2018-10-25 Thread Steve Kradel
to the > Invocation so I can pass a WebTarget (with associated headers) to the Twirp > library we're using. > > So I can see that ClientRequestContext has a 'getProperty', is there a way > for me to pass set that property on a given WebTarget? > > >

Re: Guava Services and DropWizard

2018-11-02 Thread Steve Kradel
Your approach seems like a sound one, and Dropwizard is essentially silent on the how/why of background threads, scheduling, etc. A possible consideration is that you might prefer DW to fail fast and exit on service non-start rather than "run unhealthy" in connection with startAsync. Likewise

Re: Guava Services and DropWizard

2018-11-02 Thread Steve Kradel
On Friday, November 2, 2018 at 3:56:05 PM UTC-4, Ryan Kennedy wrote: > > On Fri, Nov 2, 2018 at 12:45 PM Steve Kradel > wrote: > >> Your approach seems like a sound one, and Dropwizard is essentially >> silent on the how/why of background threads, scheduling, etc. &g

Re: Dropwizard configuration switch based on config variable

2019-04-02 Thread Steve Kradel
Have a look at Freemarker-based dynamic configuration for pointers. I don't think you'll be pleased with attempts to parse and _then_ mutate the YAML. https://github.com/tkrille/dropwizard-template-config On Tuesday, April 2, 2019 at 12:33:54 PM UTC-4, Vaibhav Somani wrote: > > Hi, > > The valu

Re: Has anyone generated Swagger UI from an endpoint requiring authentication?

2019-11-01 Thread Steve Kradel
@ApiParam(hidden = true) will tell Swagger/OpenAPI not to include that parameter in the spec. On Friday, November 1, 2019 at 1:57:12 PM UTC-4, Jason Novotny wrote: > > Hi, > > Given an API requiring authentciation like so: > > @Path("/updateUser") > @POST > public String updateUser(@Auth UserPrin

Re: Has anyone generated Swagger UI from an endpoint requiring authentication?

2019-11-01 Thread Steve Kradel
} Additionally, AssetsBundle serves up swagger-ui resources. On Friday, November 1, 2019 at 3:32:08 PM UTC-4, Robert Di Falco wrote: > > I have a related question. Anyone used the dropwizard swagger extension > but had Swagger be on the same HTTPS and port as the rest end point? > > On

Re: Has anyone generated Swagger UI from an endpoint requiring authentication?

2019-11-01 Thread Steve Kradel
> > As you can see from the screenshot it works and it returns the token that > is used in subsequent calls requiring authentication. > > 2. Given an API endpoint requiring authentication-- how can a Swagger UI > user call this API? How to pass in the token from above? >