ESB Toolkitãšã¯äœã§ãããäœãé¢çœãã
ESB Toolkitã¯BizTalkãµãŒããŒçšã®ããŒã«ãããã§ãããçµ±åã¢ããªã±ãŒã·ã§ã³ã®éçºãç°¡çŽ åããŸãã
ããã¯æ¬æ Œçãªè£œåãäœæã§ãã匷åãªããŒã«ã§ãããšããäºå®ã«ãããããããæåã«é äºãããã®ã¯ãBizTalkã®éçºãããã¯ãå ¥åããããã®äœãããããå€ãã§ãã ãªãŒã±ã¹ãã¬ãŒã·ã§ã³ã§ã¯è§£æ±ºãå°é£ãªå€ãã®ã¿ã¹ã¯ã¯ãESB Toolkitã䜿çšããŠç°¡åã«è§£æ±ºã§ããŸãã
Microsoftã¯ãå€ãã®äžè¬çãªã¿ã¹ã¯ã®äŸãæäŸããåªããããã¥ã¡ã³ããäœæããŸããã ããããç§ã®äŸã§ã¯ããã®ããŒã«ã䜿çšãããšããäžè¬çãªã¢ã€ãã¢ãæµ®ããã ãšãã«ããã®ããã¥ã¡ã³ãã圹ç«ã€ããšã«æ°ä»ããŸããã ã©ããããæ zyãªããã°ã©ããŒã®æ¡ä»¶åå°ãããªã¬ãŒãããŸã-å°ãªããšãäœããæ©èœããããå€ãã®æéãç¡é§ã«ãªããŸã§ãããã¥ã¡ã³ããèªãŸãªãã§ãã ããã
å®éããã®æçš¿ã®äž»ãªç®æšã¯ãç°¡åãªã¢ããªã±ãŒã·ã§ã³ãäœæããŠãESB Toolkitã«ã觊ãããããšãã§ããããã«ããããšã§ãã BizTalkã«ç²ŸéããŠãã人ã¯ãSendPortã®ãã£ã«ã¿ãŒã䜿çšããŠããããã©ã«ããŒããå¥ã®ãã©ã«ããŒã«ãã¡ã€ã«ã転éããäŸãããããèªãã§ããã§ãããã ãã®æçš¿ã§ã¯ãESB Toolkitã®éçã«ãŒãã£ã³ã°ã䜿çšããŠäŸãç¹°ãè¿ããŠããŸãã
åææ¡ä»¶
éçºã«ã¯ãBizTalk Server 2010ãšVisual Studio 2010ã䜿çšãããŸãã
éçºã®åã«ãVisual Studioçšã®ESB Toolkitãšãã®ã³ã³ããŒãã³ããã€ã³ã¹ããŒã«ããå¿ èŠããããŸãã ã€ã³ã¹ããŒã«ã¯Microsoftã®Webãµã€ãã§èª¬æãããŠããŸãããªã³ã¯ã¯æçš¿ã®æåŸã«ãããŸãã
æºåãã
æåã«ãéçºã§äœ¿çšããæ°ããã¢ããªã±ãŒã·ã§ã³ãæºåããŸãã
ã¢ããªã±ãŒã·ã§ã³ã«EsbToolkitTestãšããååãä»ããŸãããã
Referencesã§ãMicrosoft.Practices.ESBã¢ããªã±ãŒã·ã§ã³ãžã®ãªã³ã¯ãè¿œå ããå¿ èŠããããŸãã
äœæããã¢ããªã±ãŒã·ã§ã³ã§ãåä¿¡ããŒããäœæããåä¿¡å Žæãè¿œå ããŸãã
ãã©ã«ããŒãããã¡ã€ã«ãåéããããã«åä¿¡å Žæãæ§æããŸãã ããšãã°ãCïŒ\ ESB \ inputã
BizTalkãŠãŒã¶ãŒã«ã¯ããã®ãã©ã«ããŒã«å¯Ÿããèªã¿åãããã³æžã蟌ã¿æš©éãå¿ èŠã§ããããšãå¿ããªãã§ãã ããã ãŸãã¯ã[èªèšŒ]ã¿ãã§å¥ã®ãŠãŒã¶ãŒã«ä»£ãã£ãŠã¢ã¯ã»ã¹ãæ§æããŸãã
åçãªSendPortãäœæããããšãå¿ èŠã§ãã
éä¿¡ããŒããã£ã«ã¿ã§æ¬¡ã®ãã©ã¡ãŒã¿ãèšå®ããŸãã
ãããã®ãã©ã¡ãŒã¿ãŒã«ãããããŒãã¯æ çšããã¡ãã»ãŒãžãåä¿¡ã§ããŸãã ããã§ServiceNameã¯ãªãã·ã§ã³ã§ããããšã«æ³šæããŠãã ããã
ããã§æºåã¯å®äºã§ããæ çšè¡šãäœæã§ããŸãã
æ çšãäœæãã
ã«ãŒãïŒæ çšïŒã¯ãESB Toolkitã®äž»èŠã³ã³ããŒãã³ãã§ãã 圌ãã®å©ãã«ãããç§ãã¡ã¯ã¡ãã»ãŒãžã«äœãèµ·ãããã決å®ããŸãã ã³ã³ããŒãã³ããã€ã³ã¹ããŒã«ããåŸãå€ãã®ã¿ã€ãã®ãããžã§ã¯ãã§ã«ãŒããäœæã§ããŸãã ãã®äŸã§ã¯ãæ çšãããžã§ã¯ãã«ã«ãŒããäœæããŸãã
ãã®ãããVisual Studioã§æ°ãããããžã§ã¯ããäœæããŸãã [BizTalkãããžã§ã¯ã]ã¿ãã§ãBizTalk ESB Itinerary Designerãããžã§ã¯ããå©çšå¯èœã«ãªããŸãã ã«ãŒãã«TestItineraryãšããååãä»ããŸãããã
ãã®ãããªãããžã§ã¯ããã³ãã¬ãŒãããªãå Žåã¯ãESB Toolkitã䜿çšããŠãã©ã«ããŒããã€ã³ã¹ããŒã«ããå¿ èŠããããŸãã ç§ã®ãã³ãã¬ãŒãã¯ãã©ã«ããŒCïŒ\ Program Files \ Microsoft BizTalk ESB Toolkit 2.1 \ Tools \ Itinerary Designerã«ãããŸãã ãã³ãã¬ãŒãã¯ãMicrosoft.Practices.Services.Itinerary.DslPackage.vsixãã¡ã€ã«ãå®è¡ããŠã€ã³ã¹ããŒã«ããããã®åŸVisual Studioã«è¡šç€ºãããŸãã
äœæããããããžã§ã¯ãã§ã¯ãTestItinerary.ititneraryã«ãŒããæ¢ã«è¿œå ãããŠããã¯ãã§ãã ããã«ã¯ãªãã¯ããŠæ çšãã¶ã€ããéããŸãã åœç¶ã®ããšãªãããçŸåšã³ã³ããŒãã³ãã¯ååšããã空ã®ã°ã©ããŒã·ã§ã³ã§æºè¶³ããŠããŸãã
å·ŠåŽã®ããŒã«ããã¯ã¹ã«ã䜿çšå¯èœãªã³ã³ããŒãã³ãã®ãªã¹ãã衚瀺ãããŸãã
ãã®äŸã§ã¯ãOnRampãOffRampãItinerary ServiceããããŠãã¡ããConnectorã圹ç«ã¡ãŸãã
On-Rampã¯ãããŒã¿ãœãŒã¹ããã³ãµãŒãã¹ã³ã³ãããŒã§ãã
æ çšãµãŒãã¹-ããã«ã«ãŒãã£ã³ã°ããžãã¯ããããŸãã
ãªãã©ã³ãã¯äŒéã³ã³ããŒãã³ãã§ãã éä¿¡ããŒãã«ãã€ã³ãããå¿ èŠããããŸãã 泚æããŠãã ãã-ããŒãã¯åçã§ãªããã°ãªããŸãã å®éã®äœæã¯ã«ãŒãå ã§è§£æ±ºãããŸãã
ãããã£ãŠãå³ã«ç€ºãããã«ã1ã€ã®ãªã³ã©ã³ãã2ã€ã®æ çšãµãŒãã¹ã1ã€ã®ãªãã©ã³ããæ çšãã¶ã€ããŒãšãªã¢ã«è»¢éããã³ãã¯ã¿ã§æ¥ç¶ããŸãã
2ã€ã®ã³ã³ããŒãã³ããã³ãã¯ã¿ã§æ¥ç¶ããã«ã¯ããŸãããŒã«ããã¯ã¹ã§ã³ãã¯ã¿ãã¯ãªãã¯ããæåã®ã³ã³ããŒãã³ããã¯ãªãã¯ããŠãã2çªç®ã®ã³ã³ããŒãã³ããã¯ãªãã¯ããå¿ èŠããããŸãã ã°ã©ãã£ãã¯ãšãã£ã¿ãŒã®ã¢ã¯ãã£ããŠãŒã¶ãŒã«ã¯æã åé¡ããããŸãã æåã®ã³ã³ããŒãã³ããã2çªç®ã®ã³ã³ããŒãã³ãã«ã³ãã¯ã¿ãããã«ãããããšããŸãã äºçŽ°ãªããšã§ãããäžå¿«ãªæ°åãé ä¿¡ã§ããŸãã
次ã«ãåã³ã³ããŒãã³ããšæ çšèªäœãèšå®ããå¿ èŠããããŸãã OnRamp1ã³ã³ããŒãã³ããéžæãã次ã®ããããã£ãåŠæ¹ããŸãã
ã€ãŸã ããŒã¿ãåä¿¡ããã¢ããªã±ãŒã·ã§ã³ã®åä¿¡ããŒããæå®ããã³ã³ããŒãã³ãã®ååãTestOnRampã«å€æŽããŠãExtenderãæå®ããŸãã ãªã³ã©ã³ãã«ãšã¯ã¹ãã³ããŒãéžæãããã³ã«ãããªã³ã©ã³ãESBãšã¯ã¹ãã³ããŒãã1ã€ãã䜿çšã§ããªãå Žåãããã¯æããã§ã¯ãããŸããã ã©ããããç¶æ³ã«ãã£ãŠã¯ä»ã®ãªãã·ã§ã³ããããããããŸããããç§ã¯ããã«ééããŠããŸããã
ExtenderãéžæãããŸã§ãäžéšã®ããããã£ã¯è¡šç€ºãããªãããšã«æ³šæããŠãã ããã
ã³ã³ããŒãã³ãã®ããããã£ã®èšå®ã«é¢ããã¢ããã€ã¹-çŸåšè¡šç€ºãããŠããããããã£ã瀺ããŸããäžéšã®ããããã£ã¯ãŸã å©çšã§ããªããšããäºå®ã«æ³šæãæããªãã§ãã ãã-ãããã¯å å¡«ããã»ã¹äžã«è¡šç€ºãããŸãã ããã¯ãããããã£ã§ã¯å€ãã®å Žåã³ã³ããŒãã³ãã®ã¿ã€ããæå®ããå¿ èŠããããã¿ã€ãããšã«ããããã£ã®ã»ãããç°ãªãããã§ãã
On-Rampã®åŸãItineraryService1ã«ç§»åããŸãã 次ã®ããããã£ãèšå®ããŸãã
ã€ãŸã ãªã³ã©ã³ãããã®ãµãŒãã¹ã®ã³ã³ããã«ãªãããšã¯ã¹ãã³ããŒãã¡ãã»ãŒãžã³ã°ãšã¯ã¹ãã³ããŒã«ãªããŸãã [ãµãŒãã¹å]ã§ãMicrosoft.Practices.ESB.Services.Routingãæå®ããŸã-ãã®ãµãŒãã¹ã¯ã«ãŒãã£ã³ã°ãæ åœããŸãã ã³ã³ããŒãã³ãã®ååããRoutingãã«å€æŽããŸãã
ããããã£ã®å®çŸ©ã«å ããŠãã«ãŒãã£ã³ã°ãµãŒãã¹ã«ãªãŸã«ããŒãè¿œå ããå¿ èŠããããŸãã ç§ãã¡ã®å Žåãã¢ãã¬ã¹ã解決ããŸãã ãªãŸã«ããŒãéçã«ããŸã-ãã®ããããã£ã¯å³å¯ã«ç»é²ãããåçã«å€æŽãããŸããã
ãããã£ãŠãã«ãŒãã£ã³ã°ãµãŒãã¹ãå³ã¯ãªãã¯ããŠã[è¿œå ]-> [ãªãŸã«ããŒ]ãéžæããŸãã
ã³ã³ããŒãã³ãå šäœã§ã¯ãªãããã®ç¹å®ã®ãªãŸã«ããŒã®ã³ã³ããã¹ãã¡ãã¥ãŒãåŒã³åºããšã次ã®ã¡ãã¥ãŒã衚瀺ãããŸãã
ããã§åŒ·èª¿è¡šç€ºãããŠããé ç®ã¯åã®é ç®ãšäŒŒãŠãããéãã¯ãããŸããã
ãªãŸã«ãã«ãstaticResolverããšããååãä»ãã次ã®ããããã£ãèšå®ããŸãã
BizTalkãŠãŒã¶ãŒã«ã¯ããã©ã³ã¹ããŒãã®å Žæã§æå®ããããã©ã«ããŒãžã®æžã蟌ã¿ã¢ã¯ã»ã¹èš±å¯ãå¿ èŠã§ããããšãæãåºããŸãã éçãªãŸã«ããŒã䜿çšãããšãSendPortããããã£ãããçšåºŠè©³çŽ°ã«èšå®ã§ããŸãããããšãã°ããã©ã³ã¹ããŒãã¿ã€ããšå®å ã¢ãã¬ã¹ã§ååã§ãã
確èªããã«ãŒãã£ã³ã°ãµãŒãã¹ã®ãã¹ãŠã®ããããã£ã ãªãã©ã³ãã³ã³ããŒãã³ãã«ç§»åããŸãã ItineraryService2ã³ã³ããŒãã³ãã¯çŸåšã¹ãããããŠããŸãã
ãªãã©ã³ãã³ã³ããŒãã³ãã®å Žåã次ã®ããããã£ãèšå®ããŸãã
ã€ãŸã ãªãã©ã³ãã以åã«äœæããéä¿¡ããŒãã«çµã³ä»ããŸããã ãªãã©ã³ãã§ã¯ããã調åã®ãšããååãTestOffRampããä»ããŸããã
ããã§ã¯ãItineraryService2ã³ã³ããŒãã³ãã«ç§»ããŸãããã ãã®ã³ã³ããŒãã³ãã¯ããªãã©ã³ããµãŒãã¹ã®åœ¹å²ãæãããŸãã 次ã®ããããã£ãèšå®ããŸãã
ã€ãŸã ããã¯TestOffRampã®ãªãã©ã³ããµãŒãã¹ã§ããããšã瀺ããååãå€æŽããŸããã
ããã§ãã¹ãŠãæ§æãããã¹ãŠã®ã³ã³ããŒãã³ããããã³Itinirary Designerã¯æ¬¡ã®ããã«ãªããŸãã
æ çšèªäœã®ããããã£ãèšå®ããããã«æ®ã£ãŠããŸãã ãããè¡ãã«ã¯ãã³ã³ããŒãã³ãã®ãªãå Žæãã¯ãªãã¯ããŠF4ãæŒããŸãã 次ã®ããããã£ãèšå®ããŸãã
å€æŽããããããã£ãããã«è©³ãã調ã¹ãŠã¿ãŸãããã
1. Model Exporter-Database Itinerary Exporterãã€ãŸã ã«ãŒãã¯XMLã«ãšã¯ã¹ããŒããããŸããããããã«ããŒã¿ããŒã¹ã«ãšã¯ã¹ããŒããããããããBizTalkãååŸããŸãã
2.æå·å蚌ææžãå¿ èŠ-åœã ä»ã¯å¿ èŠãããŸããã
3.æ çšã¹ããŒã¿ã¹-é åæžã¿ã å ¬éãããã«ãŒããé¢ãããšãããŒã¿ããŒã¹å ã«ååšããŸãããå©çšã§ããªããªããŸãã ã€ãŸã BizTalkã¯åŒã³åºãããšãã§ããŸããã
ãŸããNameããããã£ã«æ³šæããå¿ èŠããããŸããããã¯ãæ€çŽ¢ããã«ãŒãã®ååã§ãã ãããã¯ãªããããŒãã«ã³ããŒããŸã-ããã¯ç§ãã¡ã«ãšã£ãŠä»åœ¹ã«ç«ã€ã§ãããã
äœæããã«ãŒããä¿åããã³ã³ããŒãã³ãã®ãªãå Žæãå³ã¯ãªãã¯ããŠããã¢ãã«ã®ãšã¯ã¹ããŒããã¢ã€ãã ãéžæããŸãã ããã§ãã«ãŒããããŒã¿ããŒã¹ã«ãšã¯ã¹ããŒããããBizTalkããåŒã³åºãããšãã§ããŸãã
åä¿¡ããŒããæ§æãã
ããäžåºŠãBizTalk Server管çã³ã³ãœãŒã«ã«ç§»åããäœæããåä¿¡å Žæã®ããããã£ãéããŸãã ãã€ãã©ã€ã³ã¯å€æŽãããPassThruReceiveã®ãŸãŸã§ããã ãããå€æŽããæ çšã®éžæãã«ã¹ã¿ãã€ãºããŸãã
ãã€ãã©ã€ã³ItinerarySelectReceivePassthroughãéžæãããã®ããããã£ãéããŸãã
ãã¹ããŒãž1ïŒãã³ãŒã-ã³ã³ããŒãã³ãïŒESBæ çšã»ã¬ã¯ã¿ãŒãã»ã¯ã·ã§ã³ã§ãæ çšãéžæããããã®ããããã£ãæå®ããå¿ èŠããããŸãã
ItineraryFactKeyã§Resolver.Itineraryãæå®ããResolverConnectionString-ITINERARYã§æå®ããŸãã\\ name = TestItinerary;
Nameãã©ã¡ãŒã¿ãŒã¯ãã«ãŒãã®ååãèšå®ããŸãã éçã«ãŒãéžæã䜿çšããŸããããããšãã°ããžãã¹ã«ãŒã«ã«åºã¥ããŠåçã«ãŒããéžæããããšãã§ããŸãã
éå§ãçµäºãçµè«
BizTalk Server管çã³ã³ãœãŒã«ã§ã¢ããªã±ãŒã·ã§ã³ãèµ·åããŸãã
CïŒ\ ESBãã©ã«ããŒã«ãã¹ãããã¥ã¡ã³ããäœæããŸãã ããšãã°ãããïŒ
<?xml version="1.0" encoding="utf-8"?>
Hello world
ããã¥ã¡ã³ãããã©ã«ããŒCïŒ\ ESB \ inputã«ã³ããŒãããã©ã«ããŒCïŒ\ ESB \ outputã«è¡šç€ºãããæ§åã確èªããŸãã
ãã¹ãŠãç§ãã¡ã®ã¢ããªã±ãŒã·ã§ã³ã¯æ©èœããŸãããããªãã¯åã¶ããšãã§ããŸãã
ãã®äŸãè«ãæåã®çµè«-ESB Toolkit-ã¯é¢åãªãã®ã§ãããåãçµæãã¯ããã«ç°¡åã«éæã§ããŸãã ãã ããããã§èæ ®ããå¿ èŠãããã®ã¯ãããã§éçã«èšå®ãããã¹ãŠã®ãã®ãåçã«æ±ºå®ã§ããããšã§ãã ã€ãŸã ã¿ã¹ã¯ãå°ãè€éã«ããã ãã§ãåçãªã³ã³ãã³ãããŒã¹ã®ã«ãŒãã£ã³ã°ãšå€æãå¯èœã«ãªããŸãã ãŸããã«ãŒãèªäœã®éžæãåçã«ãªãå¯èœæ§ããããŸãã ãã®ãããã¯ãèå³æ·±ãå Žåã¯ã次ã®æçš¿ã§ããžãã¹ã«ãŒã«ã«åºã¥ããåçãªãœãªã¥ãŒã·ã§ã³ã®äŸã瀺ããŸãã
æãéèŠãªãªã³ã¯
ã䟿å©ãªãªã³ã¯ããšåŒã³ããã£ãã®ã§ããã圹ã«ç«ã€ã®ã¯1ã€ã ãã ãšããããŸããã
Microsoftã®ESBããŒã«ããã
ãã¹ãŠã®æãéèŠãªESBããŒã«ããããå«ãŸããŠããããããäœã§ããããæžãããŠãããããã¥ã¡ã³ããžã®ãªã³ã¯ãšããŒã«ãããã®ããŠã³ããŒããæäŸãããŠããŸãã ãšããã§ãç§ã¯ãã¹ã¿ãŒãããŠã³ããŒãããããšããå§ãããŸã-éåžžã«äŸ¿å©ã§èŠèŠçãªãã®ã§ãã è±èªã®ãªãœãŒã¹ã æ®å¿µãªããããã·ã¢ã®ã¢ããã°ã¯èŠã€ãããŸããã§ããã