title: How to get payload values from byte[] message in Spring Integration int-http:outbound-gateway?
body: <p>I am configuring an <code>outbound-gateway</code> in my context.xml where I want to extract values from a <code>byte[]</code> type payload and use them to construct a <code>URI</code>. I found that SpEL allows you to build it this way:</p>
  
  <pre><code>url-expression="T(org.springframework.web.util.UriComponentsBuilder)
                         .fromHttpUrl('http://HOST:PORT/PATH')
                         .queryParams(payload)
                         .build()
                         .toUri()"
  </code></pre>
  
  <p>Source: <a href="https://docs.spring.io/spring-integration/reference/html/http.html#mapping-uri-variables" rel="nofollow noreferrer">https://docs.spring.io/spring-integration/reference/html/http.html#mapping-uri-variables</a></p>
  
  <p>My variation of the solution looks like this:</p>
  
  <pre><code>&lt;int-http:outbound-gateway id="candleRequestGateway"
                             request-channel="candleRequestChannel"
                             reply-channel="dataResponseChannel"
                             http-method="GET"
                             url-expression="T(org.springframework.web.util.UriComponentsBuilder)
                                          .fromHttpUrl('some/{path}')
                                          .queryParam('myParam', payload.get('myParam'))
                                          .buildAndExpand(payload.get('path'))
                                          .toUri()"/&gt;
  </code></pre>
  
  <p>However, I am getting the following error which occurs while executing <code>payload.get('myParam')</code> part:</p>
  
  <pre><code>org.springframework.messaging.MessageHandlingException: error occurred in message handler [org.springframework.integration.http.outbound.HttpRequestExecutingMessageHandler#3]; nested exception is org.springframework.expression.spel.SpelEvaluationException: EL1004E: Method call: Method get(java.lang.String) cannot be found on type byte[]
  </code></pre>
  
  <p>I understand and agree with the error. My question: is there a way (a specific SpEL expression(?)) to extract the values from <code>byte[]</code> payload without having to transform it before it reaches the <code>outbound-gateway</code>? Is this a valid solution at all?</p>