Uploaded image for project: 'Spring Integration'
  1. Spring Integration
  2. INT-2650

TCP Endpoint - using SpEL in Spring 3.1 to convert byte[] to byte[] - high cpu load and handle time delay

    Details

      Description

      Configured tcp endpoint with tcp-gateway and simple service activator, which takes byte array as an argument. Transfer large binary files through the the endpoint (incoming). Using ByteArrayLengthHeader as serializer/deserializer.
      Using function

      public byte[] handleBinary(byte[] msg)
      

      for service activator.
      During transfer of binary files very high cpu load and there is a large tome gap between spring-integration activator functions eg.

      23:54:31,789 DEBUG: org.springframework.integration.handler.ServiceActivatingHandler - ServiceActivator for [org.spr[email protected]4f3e0c] received message: [Payload=[[email protected]][Headers={timestamp=1341179671789, id=e994c61f-9694-4ea7-87c3-fca11ff334b3, errorChannel=org.springfra[email protected]42df6c, ip_address=127.0.0.1, replyChannel=org.springfra[email protected]42df6c, ip_hostname=127.0.0.1, ip_connection_seq=9, ip_tcp_remote_port=41188, ip_connection_id=127.0.0.1:41188:6eae2c4a-8eb9-4c55-9a0b-1ab1fb779d6d}]
      23:54:32,454 DEBUG: [..package..].integration.BinaryActivator - Binary Handler: Handle binary object. Payload size: 1024005
      

      Caused by using in Spring 3.1 automatic conversion for SpEL arguments, which SI is using. Details with a solution from garry russel in the reference URL post.
      In the attachement jstack dump of the process during high cpu load.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                grussell Gary Russell
                Reporter:
                slawek.mikula Slawek Mikula
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: