-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #227 from Team-Capple/release-v0.1.0
[RELEASE] μΌν λ²μ 2 λ°°ν¬
- Loading branch information
Showing
151 changed files
with
5,530 additions
and
545 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule config
updated
from b3f9b9 to 454089
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/main/java/com/server/capple/config/apns/config/ApnsClientConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.server.capple.config.apns.config; | ||
|
||
import io.netty.handler.ssl.SslContext; | ||
import io.netty.handler.ssl.SslContextBuilder; | ||
import io.netty.handler.timeout.WriteTimeoutHandler; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import reactor.netty.http.HttpProtocol; | ||
import reactor.netty.http.client.HttpClient; | ||
import reactor.netty.resources.ConnectionProvider; | ||
|
||
import javax.net.ssl.SSLException; | ||
import java.time.Duration; | ||
import java.util.concurrent.TimeUnit; | ||
|
||
@Configuration | ||
public class ApnsClientConfig { | ||
@Bean("apnsSslContext") | ||
public SslContext getApnsSslContext() throws SSLException { | ||
return SslContextBuilder.forClient().protocols("TLSv1.2").build(); // SSL μ€μ | ||
} | ||
|
||
@Bean("apnsConnectionProvider") | ||
public ConnectionProvider getApnsConnectionProvider() { | ||
return ConnectionProvider.builder("apns") | ||
.maxConnections(10) // μ΅λ 컀λ΅μ μ | ||
.pendingAcquireMaxCount(-1) // μ¬μλ νμ (-1 : 무νλ) | ||
.pendingAcquireTimeout(java.time.Duration.ofSeconds(10)) // 컀λ₯μ νμ μ¬μ© κ°λ₯ν 컀λ₯μ μμ λμ λκΈ° μκ° | ||
.maxIdleTime(java.time.Duration.ofSeconds(5)) // μ΅λ μ ν΄ μκ° | ||
.maxLifeTime(java.time.Duration.ofSeconds(300)) // μ΅λ μλͺ μκ° | ||
.lifo() // νμ μ μΆ | ||
.build(); | ||
} | ||
|
||
@Bean("apnsH2HttpClient") | ||
public HttpClient getApnsH2HttpClient(ConnectionProvider apnsConnectionProvider, SslContext apnsSslContext) { | ||
return HttpClient.create(apnsConnectionProvider) // reactor HttpClient μμ± | ||
.keepAlive(true) // keep-alive νμ±ν | ||
.protocol(HttpProtocol.H2) // HTTP/2 νμ±ν | ||
.doOnConnected(connection -> connection.addHandlerLast(new WriteTimeoutHandler(10, TimeUnit.SECONDS))) // μ°κΈ° νμ μμ | ||
.responseTimeout(Duration.ofSeconds(10)) // μλ΅ νμ μμ | ||
.secure(sslSpec -> sslSpec.sslContext(apnsSslContext)); // SSL νμ±ν | ||
} | ||
} |
Oops, something went wrong.