Package io.sentry.transport.apache
Class ApacheHttpClientTransport
java.lang.Object
io.sentry.transport.apache.ApacheHttpClientTransport
- All Implemented Interfaces:
ITransport
,Closeable
,AutoCloseable
ITransport
implementation that executes request asynchronously in a non-blocking manner
using Apache Http Client 5.-
Constructor Summary
ConstructorDescriptionApacheHttpClientTransport
(@NotNull SentryOptions options, @NotNull RequestDetails requestDetails, @NotNull org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient httpclient, @NotNull RateLimiter rateLimiter) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
close
(boolean isRestarting) Closes the transport.void
flush
(long timeoutMillis) Flushes events queued up, but keeps the client enabled.@NotNull RateLimiter
void
send
(@NotNull SentryEnvelope envelope, @NotNull Hint hint) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.sentry.transport.ITransport
isHealthy, send
-
Constructor Details
-
ApacheHttpClientTransport
public ApacheHttpClientTransport(@NotNull @NotNull SentryOptions options, @NotNull @NotNull RequestDetails requestDetails, @NotNull @NotNull org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient httpclient, @NotNull @NotNull RateLimiter rateLimiter)
-
-
Method Details
-
send
public void send(@NotNull @NotNull SentryEnvelope envelope, @NotNull @NotNull Hint hint) throws IOException - Specified by:
send
in interfaceITransport
- Throws:
IOException
-
flush
public void flush(long timeoutMillis) Description copied from interface:ITransport
Flushes events queued up, but keeps the client enabled. Not implemented yet.- Specified by:
flush
in interfaceITransport
- Parameters:
timeoutMillis
- time in milliseconds
-
getRateLimiter
- Specified by:
getRateLimiter
in interfaceITransport
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
close
Description copied from interface:ITransport
Closes the transport.- Specified by:
close
in interfaceITransport
- Parameters:
isRestarting
- if true, avoids locking the main thread by dropping the current connection.- Throws:
IOException
-