0

Below is how my ZUUL configuration looks like.

zuul:
  routes:
    UserCards-V1: 
         path: /user/v1/accountholders/*/cards/**
         service-id: usercards-v1
         strip-prefix: false
    UserTransactions-V1_1: 
         path: /user/v1/accountholders/*/transactions
         service-id: usertransactions-v1
         strip-prefix: false
    UserTransactions-V1_2:  
         path: /user/v1/accountholders/*/accounts/*/transactions
         service-id: usertransactions-v1
         strip-prefix: false
    UserAccounts-V1: 
         path: /user/v1/accountholders/*/accounts/**
         service-id: useraccounts-v1
         strip-prefix: false
    UserCardholders-V1: 
         path: /user/v1/accountholders/**
         service-id: usercardholders-v1
         strip-prefix: false 

The problem that I am having is when I hit the url like this http://localhost:8006/user/v1/accountholders/2/transactions?page= I have a map in my API controller that reads the query params but it comes in as empty {}

And when i hit the url as below:- http://localhost:8006/user/v1/accountholders/2/transactions?page=123. The map comes in as {page=[123]}it works fine.

Can anyone help me with it i need to know that page param is empty or any other parameter that's being passed is empty. If i directly hit my api without Zuul then all works fine. I think its Zuul thats ignoring it and not forwarding it to the api.

This is my API's controller:-

 @RequestMapping(value = "/accountholders/{cardHolderId}/transactions", produces = "application/json; charset=utf-8", consumes = "application/json", method = RequestMethod.GET)
    @ResponseBody
    public TransactionsVO getTransactions(@PathVariable("cardHolderId") final String cardHolderId,

            @RequestParam final MultiValueMap<String, String> allRequestParams) {

        final String requestTimeStamp = DateUtil.getUTCDate();
        iUrlValidator.validate(cardHolderId, null, allRequestParams);
        return iTransactionService.getCardHolderTransactionsInfo(cardHolderId, requestTimeStamp, pageNumber, pageSize,
                allRequestParams);
    }
Grinish Nepal
  • 3,037
  • 3
  • 30
  • 49
  • Works for me. What version of Spring Cloud are you using? Can you maybe post a sample that reproduces the problem? – Dave Syer Feb 02 '16 at 17:43
  • @Dave Syer I think by version you mean this : spring-cloud-starter-parent:Angel.SR3. So you are saying when you pass an empty param like page= in the map you get {page=[]} in the controller of the API. – Grinish Nepal Feb 02 '16 at 18:27
  • 1
    Yes that's what I mean. I was testing with Brixton snapshots. Can you try that and see if it works for you? – Dave Syer Feb 03 '16 at 06:24
  • 1
    @Dave Syer Changing it to Brixton did fix the issue. Thanks... – Grinish Nepal Feb 03 '16 at 17:17

0 Answers0