WSO2 MSF4J를 사용하여 샘플 마이크로 서비스를 만들었습니다. 하지만 하위 리소스 (서비스)에 액세스 할 수 없습니다. 다음은 내 서비스 클래스입니다.
메시지 리소스-
@Path("/messages")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public class MessageResource {
@Path("/{messageId}/comments")
public CommentResource getCommentResource(){
System.out.println("inside the getCommentResource method");
return new CommentResource();
}
}
댓글 리소스-
@Path("/")
public class CommentResource {
@GET
@Path("/{commentId}")
public String test2(@PathParam("messageId") long messageId, @PathParam("commentId") long commentId){
System.out.println("method to return comment Id : " + commentId + " for message : " + messageId);
return "method to return comment Id : " + commentId + " for message : " + messageId;
}
}
이 서비스에 액세스하기 위해 다음 URI를 사용했습니다.
GET : http : // localhost : 8080 / messages / 1 / comments / 5
하지만 내 REST 클라이언트에 다음과 같은 결과를 얻었습니다.
404 Not Found
Problem accessing: /messages/1/comments/5. Reason: Not Found
이 문제를 해결하도록 도와주세요.
이것은 지원되지 않습니다. MSF4J는 JAXRS를 100 % 준수한다고 주장하지 않지만 마이크로 서비스를 구축하기위한 경량 프레임 워크입니다. 이를 위해 JIRA [1]을 만들었습니다. 향후 릴리스에서이를 구현할 것입니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다