Почему CachingConnectionFactory кеширует каналы, поскольку каналы являются виртуальными соединениями - PullRequest
0 голосов
/ 16 января 2020

Как говорит Do c:

Some applications need multiple logical connections to the broker. However, it is undesirable to 
keep many TCP connections open at the same time because doing so consumes 
system resources and makes it more difficult to configure firewalls. 
AMQP 0-9-1 connections are multiplexed with channels that can be thought of as 
"lightweight connections that share a single TCP connection".

Every protocol operation performed by a client happens on a channel. 
Communication on a particular channel is completely separate from communication on another 
channel, therefore every protocol method also carries a channel ID (a.k.a. channel number), 
an integer that both the broker and clients use to figure out which channel the method is for.

А весной-amqp do c он говорит:

It is important to understand that the cache size is (by default) not a limit but is merely the number of
channels that can be cached. With a cache size of, say, 10, any number of channels can actually be in use. 
If more than 10 channels are being used and they are all returned to the cache, 
10 go in the cache. The remainder are physically closed.

I ' Я немного сбит с толку, так как каналы являются виртуальными соединениями. Что означает physically closed?

Насколько я понимаю, разные каналы на самом деле представляют собой просто разные TCP-пакеты (идентифицируемые с помощью другого идентификатора канала)? И если да, то почему CachingConnectionFactory кеш каналов? (я знаю, что мое понимание должно быть неправильным 。。。)

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...