[ 
https://issues.apache.org/jira/browse/CXF-5184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13743602#comment-13743602
 ] 

Sergey Beryozkin commented on CXF-5184:
---------------------------------------

Hi, thanks for the clarifications.

To contribute a bit, I've added a test in LoadDistributorTest:

{code:java}
@Test    
    public void testFailover() throws Exception {
        LoadDistributorFeature feature = new LoadDistributorFeature();
        List<String> alternateAddresses = new ArrayList<String>();
        alternateAddresses.add(Server.ADDRESS2);
        SequentialStrategy strategy = new SequentialStrategy();
        strategy.setAlternateAddresses(alternateAddresses);
        feature.setStrategy(strategy);
        
        BookStore bookStore = getBookStore(Server.ADDRESS1, feature);
        
        // 1st call
        Book book = bookStore.getBook("123");
        assertEquals("unexpected id", 123L, book.getId());
        
        // 2nd call
        book = bookStore.getBook("123");
        assertEquals("unexpected id", 123L, book.getId());
    }
{code}

It fails during the 2nd call, exactly as you described in this JIRA. 
So I can continue working with your fix to get the above test passing.

Please double check the above test passes for you with your local fix

thanks

                
> javax.ws.rs.NotFoundException while using LoadDistributorFeature after 
> failover of 1st node or with single node configured
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-5184
>                 URL: https://issues.apache.org/jira/browse/CXF-5184
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.7.6
>         Environment: jdk7
>            Reporter: Jacek Obarymski
>         Attachments: CXF-5184.patch
>
>
> I've configured JAX-RS proxy to work with LoadDistributorFeature. 
> If failover occurs on the first node OR when there's only a single 'healthy' 
> (no failover) node configured then I'm getting javax.ws.rs.NotFoundException 
> as a result of a second call to the proxy. 
> All works fine with FailoverFeature or without any clustering features 
> enabled.
> {code:tile=proxy inteface}
> @Path("/library")
> public interface Library {
>       @GET
>       @Path("/books")
>       Books getAllBooks();
>       
> }
> {code}
> {code:title=client}
>               LoadDistributorFeature feature = new LoadDistributorFeature();
>               SequentialStrategy strategy = new SequentialStrategy();
>               strategy.setAlternateAddresses(asList("http://localhost:8080";));
>               feature.setStrategy(strategy);
>               
>               JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
>               List<Feature> features = new ArrayList<Feature>();
>               features.add(feature);
>               bean.setFeatures(features);
>               bean.setAddress("http://dummy:8080";);
>               bean.setResourceClass(Library.class);
>               Library library = bean.create(Library.class);
>               
>               library.getAllAuthors();
>               
>               library.getAllAuthors; //I'm getting the exception here
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to