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
package com.test.quartz | |
import java.util | |
import org.asynchttpclient.{DefaultAsyncHttpClient, DefaultAsyncHttpClientConfig, Param, RequestBuilder} | |
import org.asynchttpclient.proxy.ProxyServer | |
import org.asynchttpclient.ws.{WebSocket, WebSocketTextListener, WebSocketUpgradeHandler} | |
import org.json4s._ | |
import org.json4s.native.JsonMethods._ | |
import org.json4s.native.Serialization |
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
Each TCP/IPv4 connection in general consists of two endpoints, and each endpoint consists of an IP address and a port number. | |
Therefore, when a client connects to a server, an established connection can be thought of as the 4-tuple of (server IP, server port, client IP, client port). | |
When a connection is established from client to server, the client side of the connection will be assigned a source port number (other than reserved range). | |
Unless a client program explicitly requests a specific port number, the port number assigned is an ephemeral port number. | |
Ephemeral ports are temporary ports assigned by a machine's IP stack, and are assigned from a designated range of ports for this purpose. | |
Note : As of Windows Server 2008, it uses a large range (49152-65535) by default. | |
Every TCP connection must terminate through the TIME_WAIT state before it is really completed. | |
The purpose of TIME-WAIT is to prevent delayed packets from one connection being accepted by a later connection. |
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
RabbitMQ | |
* Written in Erlang | |
* Scaling strategies - is mostly vertical | |
* Supports topics and queues | |
* if you want to have high persistence guarantees, RabbitMQ ensures replication across the cluster and on disk on message send. | |
* Reliable message broker as we get acknowledgement (AMQP based) | |
* Use RabbitMQ if you have messages (20k+/sec) that need to be routed in complex ways to consumers, you want per-message delivery guarantees, you don’t care about ordered delivery, you need HA at the cluster-node level now, and/or you need 24×7 paid support in addition to forums/IRC. | |
* RabbitMQ is good for “slow” and unreliable consumers |
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
import java.util.concurrent.Executors | |
import com.google.common.util.concurrent.ThreadFactoryBuilder | |
/** | |
* Created by ranand on 4/26/2017 AD. | |
*/ | |
object TestThread { | |
def main(args: Array[String]): Unit = { | |
val threadFactory =new ThreadFactoryBuilder() |