반응형
Introduction

With the new POProcessing system in place, Pega’s widget supply business continues to grow rapidly.
However, with growth there are now some problems developing from Customer Support. Recently, Pega’s Customer Support has alerted the IT department there have been complaints regarding certain aspects of the new POProcessing service.

Many Purchase Orders are being rejected due to credit card transactions processing failures. The failure rate has been thirty percent and deemed unacceptable by Mega Corporation, one of Pega’s largest customers. Mega, who should never have a declined credit issue, has escalated to Pega’s Executive Mangement. Rapid improvements must occur in the next 30 days or they will consider switching to another supplier.

Upon investigation of the complaints, Pega’s IT identified two issues:
1. The current Credit Service Validation Service Provider is unreliable and cannot handle the load required by Pega’s growing customer base.
2. Due to the failures, Mega keeps checking status of the PO orders causing unnecessary load and spikes on Pega’s infrastructure.

Upon completion of this Lab, you will learn how Oracle Service Bus can help provide solutions to both issues. OSB will help Pega scale their integration infrastructure through Endpoint Management and Service Result Caching.





Endpoint Management

L4 같은거 처럼 OSB 단에서 Endpoint를 여러개 두고 라우팅 할 수 있습니다. (기능은 미약하겠지만?...)

 


OSB에서 CreditValidation 서비스를 더 추가해봅시다.

저는 아래와 같이 파티션만 나워서 같은 서비스를 하나 더 등록했습니다.



파티션 만드는 법은 soa-infra 에서 마우스 오른쪽 버튼 클릭 - Manage Partitions 선택



"Create" 버튼 클릭 후 파티션 이름을 입력하면 만들어집니다.



이제 OSB 콘솔로 접속해서 세션을 생성합니다.



Porject Explorer - Credit_Services - ProxyServices 이동 후 validationForCC 선택


"Transport Configuratinn"을 수정합니다.



또 하나의 WSDL 주소를 추가합니다.



아래와 같이 두개의 서비스 대상이 추가되었습니다. Next 클릭.


Save 클릭.



Operations - Dashboard - Service Health 탭으로 이동 후 "validationForCC"을 선택합니다.


"Endpoint URIs" 탭을 보면 아래와 같이 확인할 수 있습니다. 현재는 실행된게 없군용...


수정사항 적용 후 테스트 해봅시다.

Project Explorer - Credit_Services - ProxyServices 에서 "ValidateCredit"를 테스트 합니다.

카드번호: 1234-1234-1234-1234


총 10번을 테스트 해봅니다.

그 후 EM에서 인스턴스가 실행된 결과를 보면 아래와 같이 5번씩 번갈아서 실행된 것을 볼 수 있습니다.


이번에는 dummy 파티션의 validationForCC 조합을 배치 해제 하겠습니다.




OSB 콘솔에서 다시 10번을 테스트 해보면 default 파티션쪽의 서비스 5번만 실행된 것을 볼 수 있습니다.


정리해보면 아래와 같습니다. 에러가 나든 말든 무조건 분기 하는군요.. ㄷㄷ..



에러가 난것은 패스되게 할 수 없을까? -_-;; 물론 있습니다!

"BusinessServices"에 "validationForCC"을 수정합시다.

"Operational Settings" 탭에 보면 "Offline Endpoint URIs" 라는 부분을 활성화 시키면 됩니다.

아래와 같이 설정을 하게되면 최초 한번은 그냥 시도를 하고 에러가 났을 때 5분 동안은 다시 그 서비스를 부르지 않습니다.

5분이 지나면 다시 한번 시도합니다.


10번을 다시 테스트 해보면 default 파티션으로 9번이 실행 되었습니다.

1번은 dummy 파티션쪽 서비스를 실행하다가 에러가 난 것입니다.



2번째 실행에서 dummy 파티션의 서비스가 없어서 에러가 나고 3번째 부터는 정상적인 것으로 라우팅을 하게 됩니다.



다시 상태를 봐보면 Offline으로 표시가 되는군요.. 흠...





Service Result Caching

제목에 모든 설명이 다 나와있군요...

처리시마다 조회되는 (하지만 별로 변하지 않는) 서비스는 캐시를 이용해서 처리되는 시간을 단축시켜봅시다!

아래 글미과 같이 A 서비스와 B 서비스와의 결과 값이 항상 같다면 A에서 받은 결과를 캐시에 담아놨다가 B에 요청하려고 하면 캐시에 담아져있는 데이터를 사용하면 되겠습니다. (맞나? -_-)


OSB 콘솔에서 세션을 생성합니다.



System Administration - Import 에서 chap-2B_starting-caching.jar 파일을 입포트합니다.



Import 버튼 클릭.


수정사항을 적용 합니다.



※ 만약 주소나 포트가 틀리면 아래와 같이 Endpoint URI 부분을 수정해줘야 합니다.


Resource Browser 로 이동합니다.



GetPO 선택.


"Message Handling Configuration" 을 수정합니다.


"Advanced Settings"을 확장합니다.


"Result Caching"을 활성화 하고, 시간 간격을 1분으로 서정합니다.

"Cache Token Expression"은 "$body/po:PO_ID" 입력.


Save 버튼 클릭.



POStatus - ProxyServices 에서 "GetPO"의 메세지 흐름을 수정합니다.


"GetPO" 클릭 - "Add Pipeline Pair" 선택


"Response Pipeline" 클릭 - "Add Pipeline Pair" 선택


stage1 클릭 - "Edit State" 선택


"Add an Action" 클릭 - Message Processing - Replace 선택


"variable"에 "header" 입력 후 <Expression> 클릭.



아래와 같이 입력 후 Save 버튼 클릭
<caching-metadata>
<cache-originated>{$outbound/ctx:transport/ctx:response/tp:cache-originated/text()}</cache-originated>
<cache-token>{$outbound/ctx:transport/ctx:response/tp:cache-token/text()}</cache-token>
</caching-metadata>


"Replace node contents" 선택.



"Save All" 버튼 클릭하여 모두 저장 후 수정사항을 적용합니다. (Activate)

테스트 해봅시다.


"2222" 입력 후 Execute 버튼 클릭.



cache-originated[각주:1] 값이 false 입니다. 캐쉬 데이터가 아니라는 것이죠!


1분 내에 다시 테스트를 해봅니다.

이번에는 캐쉬된 데이터라는군요 ㅎㅎㅎ





  1. 비롯되다, 유래하다 [본문으로]
반응형
//