Traefik Ingress for Rabbitmq AMQP

Hello,
I am trying to create ingressRoute/ingressRouteTCP for my rabbit's AMQP port 5672.

This is setup of my service made with rabbitmq-operator:

spec:
  ports:
    - name: management
      protocol: TCP
      appProtocol: http
      port: 15672
      targetPort: 15672
    - name: amqps
      protocol: TCP
      appProtocol: amqps
      port: 5671
      targetPort: 5671
    - name: management-tls
      protocol: TCP
      appProtocol: https
      port: 15671
      targetPort: 15671
    - name: prometheus-tls
      protocol: TCP
      appProtocol: prometheus.io/metric-tls
      port: 15691
      targetPort: 15691
    - name: amqp
      protocol: TCP
      appProtocol: amqp
      port: 5672
      targetPort: 5672
  selector:
    app.kubernetes.io/name: rabbitmq
  clusterIP: 10.233.8.40
  clusterIPs:
    - 10.233.8.40
  type: ClusterIP
  sessionAffinity: None
  ipFamilies:
    - IPv4
  ipFamilyPolicy: SingleStack

And this is setup of my ingressRouteTCP:

apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
  name: rabbitmq-amqp
  namespace: spark-dev-sparrow
spec:
  entryPoints:
    - amqp
  routes:
    - match: HostSNI(`rabbitmq-amqp.example.com`)
      services:
        - name: rabbitmq
          port: 5672

It don't work for me at all while I am trying to connect via Queue explorer. This is an error:

Cannot read queues from machine Sparrow - rabbitmq-amqp.example.com (RabbitMQ).

StackTrace: 
System.ApplicationException: Could not load machine overview: Unable to connect to the remote server ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond IPIPIPIP
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetResponse()
   at EasyNetQ.Management.Client.HttpWebRequestExtensions.GetHttpResponse(HttpWebRequest request)
   at EasyNetQ.Management.Client.ManagementClient.Get[T](String path, Object[] queryObjects)
   at EasyNetQ.Management.Client.ManagementClient.GetOverview(GetLengthsCriteria lengthsCriteria, GetRatesCriteria ratesCriteria)
   at Cogin.RabbitMQ.Services.RMQMachineLoader.GetOverview(ManagementClient client, RMQLoadedMachine prevLoadedMachine)
   --- End of inner exception stack trace ---
   at Cogin.RabbitMQ.Services.RMQMachineLoader.GetOverview(ManagementClient client, RMQLoadedMachine prevLoadedMachine)
   at Cogin.RabbitMQ.Services.RMQMachineLoader.LoadMachine(ManagementClient client, IWorker worker, RMQCountMode countMode)
   at Cogin.RabbitMQ.Services.RMQBrokerService.LoadTreeItem(IWorker worker, TreeItem treeItem, Boolean showNonWritableQueues, Boolean isAutoRefresh, QueueDataInfo selectedQueue)
   at ev.b.g(IWorker A_0)
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at fc.a.d()

Version: QueueExplorer Standard v5.0.25
.Net Framework Version: 4.8.0
OS: Windows 10```

There seems to be a backtick missing:

No connection seems like a basic networking problem. Does the DNS have the correct IP, which port is used, is the port open?

It's my typo during changing the URL when I was writing a post.
Everything is open and it shoudn't couse any problems

Connection can’t be established. So it’s a mismatch of IP/port or those are not listening or not accessible.

I find it strange that you get the error with HttpWebRequest, you should check which protocol/port the client is trying to use.

This is setup of the client

Well, it seems it uses two ports, so you should enable both.

spec:
  entryPoints:
    - web
  routes:
    - kind: Rule
      match: Host(`rabbitmq-sparrow.example.com`)
      middlewares:
        - name: redirect-https
      services:
        - name: rabbitmq
          port: 15672

Second one works perfectly. That's why I didn't mention that

You complain about your tool not being able to connect. It uses two ports for potentially two different protocols.

This is what ChatGPT says:

Port 5672: AMQP 0-9-1 protocol, used for client-broker communication
Port 15672: HTTP/HTTPS protocol, used for web management interface

Your HttpWebRequest error indicates it’s rather the second port, that has an issue.

Well I can tell that it works, beacuse via this URL I can login to the rabbita dashboard.

Did the original SocketException provide IP and port? Does that match with Traefik host?

Yes it match. I am talking with networking guys do we have open port 5672 on 100%

I found something. Ofcourse 15672 for management changes to 80, beacuse of ingressRoute.
This is new error:

Cannot read queues from machine Sparrow - rabbitmq-amqp-sparrow.example.com (RabbitMQ).

StackTrace: 
System.ApplicationException: Could not load machine overview: Unexpected Status Code: 401 Unauthorized ---> EasyNetQ.Management.Client.UnexpectedHttpStatusCodeException: Unexpected Status Code: 401 Unauthorized
   at EasyNetQ.Management.Client.ManagementClient.Get[T](String path, Object[] queryObjects)
   at EasyNetQ.Management.Client.ManagementClient.GetOverview(GetLengthsCriteria lengthsCriteria, GetRatesCriteria ratesCriteria)
   at Cogin.RabbitMQ.Services.RMQMachineLoader.GetOverview(ManagementClient client, RMQLoadedMachine prevLoadedMachine)
   --- End of inner exception stack trace ---
   at Cogin.RabbitMQ.Services.RMQMachineLoader.GetOverview(ManagementClient client, RMQLoadedMachine prevLoadedMachine)
   at Cogin.RabbitMQ.Services.RMQMachineLoader.LoadMachine(ManagementClient client, IWorker worker, RMQCountMode countMode)
   at eq.b.d(IWorker A_0)
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at fc.a.d()

Version: QueueExplorer Standard v5.0.25
.Net Framework Version: 4.8.0
OS: Windows 10