Showing posts with label OSB. Show all posts
Showing posts with label OSB. Show all posts

Tuesday, June 23, 2015

Choosing Between Route, Service Callout and Publish

When you are first starting with OSB it can be a little tricky to determine when to use a Route, Service Callout or a Publish node.  All three can be used to call either a Business service or a local Proxy service.  You can use the following lists to determine which will best fit your needs.


Route
  1. Last node in request processing.  It can be thought of as a bridge between request pipeline processing and the response pipeline processing.
  2. You can only execute one route in your Proxy Service.
  3. Can only be created in a route node.
  4. OSB will wait for the Route call to finish before continuing to process.
    1. If you are calling a Business service and you specify Best Effort for QoS (Quality of Service), then OSB will release the thread it is holding while the business service executes.
    2. If you are calling a Business service and you specify Exactly Once or At Least Once for QoS, then OSB will hold onto the thread while the business service executes.
    3. If you are calling a local Proxy service, then OSB will hold onto the thread until the Proxy service finishes executing.
Service Callout
  1. Can have multiple Service Callout nodes in a Proxy service.
  2. Pipeline processing will continue after a Service Callout.
  3. Can be invoked from the request and/or response pipelines.
  4. Used to enrich the incoming request or outgoing response. For example, a call to get a country code.
  5. Used for real time request/response calls (Synchronous calls).
  6. OSB will hold a thread and not continue until the Service Callout completes.
  7. Can tie up resources and degrade performance under heavy loads.
Publish
  1. Can be synchronous or asynchronous
    1. If you are calling a business service with a Quality of Service of Best Effort , then it will be an asynchronous call.
    2. If you call a business service with a Quality of Service of Exactly Once or At Least Once, OSB will wait until the processing completes in the business service completes before proceeding and it is effectively a synchronous call.
    3. If you are calling a local proxy service, OSB will wait until the processing in the local proxy service completes and it is effectively a synchronous call.
  2. Can be invoked from the request and/or response pipelines.
  3. Best to use when you do not need to wait for a response from the process you are calling (Fire and Forget.... Asynchronous Calls)

Tuesday, June 16, 2015

OSB BEST PRACTICES.

Strive to have a single message representation for as much of the pipeline as possible. This makes it easy to insert things at various points since you don’t have to think about what the current document format is.

Always configure the service-level error handler. For non-SOAP services the built-in error handler only returns a transport error code since there is no standard error response document like a SOAP fault that it can auto generate.

When publishing or routing to multiple services use the table version of those actions. A table is typically more efficient than a chained if/then/else.

If a proxy service has a WSDL with multiple operations, it is generally recommended to use operational branching to handle messages separately for each operation.

Update Actions like Delete, Insert, Replace, Rename are more efficient for minor fixes to a document than using Assign with an 

XQuery that regenerates the entire document, especially if the document is large.

XQuery Transformation:

§ XQuery mapper may be more productive (faster) to use than coding a sequence of low level actions.

§ An XQuery subroutine may be less efficient than using the low level built in transformation actions such as Rename, Delete, etc

Recommendation: Use whatever tooling you are comfortable with. If performance is an issue use action level performance metrics to identify the actions to refactor.

If the document is small doing a dozen update actions instead of a single Assign might be more expensive.
Batch file processing: For large but low priority jobs that arrive over immediate transports like HTTP, consider configuring an HTTP proxy to accept incoming documents and publish them to a local directory using a file-based business service. Separately configure a file-based proxy that polls the directory after-hours and processes the files.
The default (unconditional) routing configuration has the best performance as the message is streamed without interruption.
Users with console write access should never share a userid because console sessions are managed per userid. For example, if two users that use the same userid make changes in the console, each could affect the changes the other is making.

ALSB service bus leverages the High Availability features of Weblogic service. The service bus uses the same cluster configuration and provides high availability through the cluster configuration.

In addition one may configure the services on the bus using high availability option so that the service may be exposed in multiple URIs and if one is not available the others will be accessed automatically. Finally, data dependent routing feature of the service bus will help users to route the messages to various end points achieving high availability.

If a proxy service is of type Any SOAP or Any XML, you can use a stage action to determine what the message type is, and use a conditional branching node in the flow to separate processing for each message type received.

Conditional branching can be used to expose the routing alternatives at the top level flow view. For example if you invoke service A or service B based on a condition, instead of configuring this conditional branching within the route node, you can expose or highlight this branching in the message flow itself, and use simple route nodes as the subflows for each of the branches. This is a style decision that you must make. Note that the approach of configuring the route node within each of the branches can get awkward if the fanout of messages from the branch is large.

A single stage in a pipeline is often sufficient for most use cases you configure. However there are cases for which you might consider multiple stages.

§ Multiple stages provide a natural modularity compared to configuring all the actions in a single stage.

§ Each stage in a request or response pipeline can have a separate error handling pipeline. If you design your pipeline with multiple stages, you can avoid writing a single error handler that must handle all errors by all actions in a single stage.

§ If you use the resume action (in an error handler) or the skip action, the behaviour is to resume processing at the next stage in the request or response pipeline. Therefore, depending on the logic you want to enforce, it can be a good design principle to put actions subsequent to a resume or skip action in subsequent stages.

Tuesday, June 9, 2015

List Of XQuery functions supported by OSB

NAMESPACES
------------------------------------------------------------------------
xml=http://www.w3.org/XML/1998/namespace
fn=http://www.w3.org/2004/07/xpath-functions
op=http://www.w3.org/2004/07/xpath-operators
err=http://www.w3.org/2004/07/xqt-errors
fn-bea=http://www.bea.com/xquery/xquery-functions
op-bea=http://www.bea.com/xquery/xquery-operators
dt-bea=http://www.bea.com/xquery/xquery-datatypes
var-bea=http://www.bea.com/xquery/xquery-variables
xf-aug02=http://www.w3.org/2002/08/xquery-function
op-aug02=http://www.w3.org/2002/08/xquery-operators
xs=http://www.w3.org/2001/XMLSchema
xsd=http://www.w3.org/2001/XMLSchema
xdt=http://www.w3.org/2004/07/xpath-datatypes
local=http://www.w3.org/2004/07/xquery-local-functions
declare default function namespace "http://www.w3.org/2004/07/xpath-functions



XQUERY FUNCTIONS
------------------------------------------------------------------------
fn:node-name($arg as node()?) as xs:QName?
fn:nilled($arg as node()?) as xs:boolean?
fn:string($arg as item()?) as xs:string
fn:data($arg as item()*) as xdt:anyAtomicType*
fn:base-uri() as xs:anyURI?
fn:base-uri($arg as node()?) as xs:anyURI?
fn:document-uri($arg as node()?) as xs:anyURI?
fn:error() as none
fn:error($error as xs:QName) as none
fn:error($error as xs:QName?, $description as xs:string) as none
fn:error($error as xs:QName?, $description as xs:string, $error-object as item()*) as none
fn-bea:inlinedXML($arg as xs:string) as node()*
fn-bea:serialize($arg as item()*) as xs:string
xs:string($arg as xdt:anyAtomicType?) as xs:string?
xs:boolean($arg as xdt:anyAtomicType?) as xs:boolean?
xs:decimal($arg as xdt:anyAtomicType?) as xs:decimal?
xs:float($arg as xdt:anyAtomicType?) as xs:float?
xs:double($arg as xdt:anyAtomicType?) as xs:double?
xs:long($arg as xdt:anyAtomicType?) as xs:long?
xs:unsignedLong($arg as xdt:anyAtomicType?) as xs:unsignedLong?
xs:int($arg as xdt:anyAtomicType?) as xs:int?
xs:unsignedInt($arg as xdt:anyAtomicType?) as xs:unsignedInt?
xs:short($arg as xdt:anyAtomicType?) as xs:short?
xs:unsignedShort($arg as xdt:anyAtomicType?) as xs:unsignedShort?
xs:byte($arg as xdt:anyAtomicType?) as xs:byte?
xs:unsignedByte($arg as xdt:anyAtomicType?) as xs:unsignedByte?
xs:integer($arg as xdt:anyAtomicType?) as xs:integer?
xs:positiveInteger($arg as xdt:anyAtomicType?) as xs:positiveInteger?
xs:nonPositiveInteger($arg as xdt:anyAtomicType?) as xs:nonPositiveInteger?
xs:negativeInteger($arg as xdt:anyAtomicType?) as xs:negativeInteger?
xs:nonNegativeInteger($arg as xdt:anyAtomicType?) as xs:nonNegativeInteger?
xs:anyURI($arg as xdt:anyAtomicType?) as xs:anyURI?
xs:QName($arg as xs:string?) as xs:QName?
xs:Name($arg as xdt:anyAtomicType?) as xs:Name?
xs:NCName($arg as xdt:anyAtomicType?) as xs:NCName?
xs:duration($arg as xdt:anyAtomicType?) as xs:duration?
xs:dateTime($arg as xdt:anyAtomicType?) as xs:dateTime?
xs:date($arg as xdt:anyAtomicType?) as xs:date?
xs:time($arg as xdt:anyAtomicType?) as xs:time?
xs:gYearMonth($arg as xdt:anyAtomicType?) as xs:gYearMonth?
xs:gYear($arg as xdt:anyAtomicType?) as xs:gYear?
xs:gMonthDay($arg as xdt:anyAtomicType?) as xs:gMonthDay?
xs:gMonth($arg as xdt:anyAtomicType?) as xs:gMonth?
xs:gDay($arg as xdt:anyAtomicType?) as xs:gDay?
xdt:yearMonthDuration($arg as xdt:anyAtomicType?) as xdt:yearMonthDuration?
xdt:dayTimeDuration($arg as xdt:anyAtomicType?) as xdt:dayTimeDuration?
xs:normalizedString($arg as xdt:anyAtomicType?) as xs:normalizedString?
xs:hexBinary($arg as xdt:anyAtomicType?) as xs:hexBinary?
xs:base64Binary($arg as xdt:anyAtomicType?) as xs:base64Binary?
xdt:untypedAtomic($arg as xdt:anyAtomicType?) as xdt:untypedAtomic?
xs:token($arg as xdt:anyAtomicType?) as xs:token?
xs:language($arg as xdt:anyAtomicType?) as xs:language?
xs:NMTOKEN($arg as xdt:anyAtomicType?) as xs:NMTOKEN?
xs:ID($arg as xdt:anyAtomicType?) as xs:ID?
xs:IDREF($arg as xdt:anyAtomicType?) as xs:IDREF?
xs:ENTITY($arg as xdt:anyAtomicType?) as xs:ENTITY?
fn:abs($arg as numeric?) as numeric?
fn:ceiling($arg as numeric?) as numeric?
fn:floor($arg as numeric?) as numeric?
fn:round($arg as numeric?) as numeric?
fn:round-half-to-even($arg as numeric?) as numeric?
fn:round-half-to-even($arg as numeric?, $precision as xs:integer) as numeric?
fn:compare($comparand1 as xs:string?, $comparand2 as xs:string?) as xs:integer?
fn:compare($comparand1 as xs:string?, $comparand2 as xs:string?, $collation as xs:string) as xs:integer?
fn:concat($arg1 as xdt:anyAtomicType?, $arg2 as xdt:anyAtomicType?, ...) as xs:string
fn:string-join($arg1 as xs:string*, $arg2 as xs:string) as xs:string
fn-bea:trim($string as xs:string) as xs:string
fn-bea:trim-left($string as xs:string) as xs:string
fn-bea:trim-right($string as xs:string) as xs:string
fn:substring($sourceString as xs:string?, $startingLoc as xs:double) as xs:string
fn:substring($sourceString as xs:string?, $startingLoc as xs:double, $length as xs:double) as xs:string
fn:string-length($arg as xs:string?) as xs:integer
fn:normalize-space($arg as xs:string?) as xs:string
fn:normalize-unicode($arg as xs:string?) as xs:string
fn:normalize-unicode($arg as xs:string?, $normalizationForm as xs:string) as xs:string
fn:upper-case($arg as xs:string?) as xs:string
fn:lower-case($arg as xs:string?) as xs:string
fn:translate($arg as xs:string?, $mapString as xs:string, $transString as xs:string) as xs:string
fn:escape-uri($uri-part as xs:string?, $escape-reserved as xs:boolean) as xs:string
fn-bea:format-number($number as xs:double, $pattern as xs:string) as xs:string
fn:contains($arg1 as xs:string?, $arg2 as xs:string?) as xs:boolean
fn:contains($arg1 as xs:string?, $arg2 as xs:string?, $collation as xs:string) as xs:boolean
fn:starts-with($arg1 as xs:string?, $arg2 as xs:string?) as xs:boolean
fn:starts-with($arg1 as xs:string?, $arg2 as xs:string?, $collation as xs:string) as xs:boolean
fn:ends-with($arg1 as xs:string?, $arg2 as xs:string?) as xs:boolean
fn:ends-with($arg1 as xs:string?, $arg2 as xs:string?, $collation as xs:string) as xs:boolean
fn:substring-before($arg1 as xs:string?, $arg2 as xs:string?) as xs:string
fn:substring-before($arg1 as xs:string?, $arg2 as xs:string?, $collation as xs:string) as xs:string
fn:substring-after($arg1 as xs:string?, $arg2 as xs:string?) as xs:string
fn:substring-after($arg1 as xs:string?, $arg2 as xs:string?, $collation as xs:string) as xs:string
fn:matches($input as xs:string?, $pattern as xs:string) as xs:boolean
fn:matches($input as xs:string?, $pattern as xs:string, $flags as xs:string) as xs:boolean
fn:replace($input as xs:string?, $pattern as xs:string, $replacement as xs:string) as xs:string
fn:replace($input as xs:string?, $pattern as xs:string, $replacement as xs:string, $flags as xs:string) as xs:string
fn:tokenize($input as xs:string?, $pattern as xs:string) as xs:string?
fn:tokenize($input as xs:string?, $pattern as xs:string, $flags as xs:string) as xs:string?
fn:codepoints-to-string($arg as xs:integer*) as xs:string
fn:string-to-codepoints($arg as xs:string?) as xs:integer*
fn:resolve-uri($relative as xs:string?) as xs:anyURI?
fn:resolve-uri($relative as xs:string?, $base as xs:string) as xs:anyURI?
fn:true() as xs:boolean
fn:false() as xs:boolean
fn:not($arg as item()*) as xs:boolean
fn:years-from-duration($arg as xdt:yearMonthDuration?) as xs:integer?
fn:months-from-duration($arg as xdt:yearMonthDuration?) as xs:integer?
fn:days-from-duration($arg as xdt:dayTimeDuration?) as xs:integer?
fn:hours-from-duration($arg as xdt:dayTimeDuration?) as xs:integer?
fn:minutes-from-duration($arg as xdt:dayTimeDuration?) as xs:integer?
fn:seconds-from-duration($arg as xdt:dayTimeDuration?) as xs:decimal?
fn:year-from-dateTime($arg as xs:dateTime?) as xs:integer?
fn:month-from-dateTime($arg as xs:dateTime?) as xs:integer?
fn:day-from-dateTime($arg as xs:dateTime?) as xs:integer?
fn:hours-from-dateTime($arg as xs:dateTime?) as xs:integer?
fn:minutes-from-dateTime($arg as xs:dateTime?) as xs:integer?
fn:seconds-from-dateTime($arg as xs:dateTime?) as xs:decimal?
fn:year-from-date($arg as xs:date?) as xs:integer?
fn:month-from-date($arg as xs:date?) as xs:integer?
fn:day-from-date($arg as xs:date?) as xs:integer?
fn:hours-from-time($arg as xs:time?) as xs:integer?
fn:minutes-from-time($arg as xs:time?) as xs:integer?
fn:seconds-from-time($arg as xs:time?) as xs:decimal?
fn:timezone-from-time($arg as xs:time?) as xdt:dayTimeDuration?
fn:timezone-from-date($arg as xs:date?) as xdt:dayTimeDuration?
fn:timezone-from-dateTime($arg as xs:dateTime?) as xdt:dayTimeDuration?
fn:adjust-dateTime-to-timezone($arg as xs:dateTime?) as xs:dateTime?
fn:adjust-dateTime-to-timezone($arg as xs:dateTime?, $timezone as xdt:dayTimeDuration?) as xs:dateTime?
fn:adjust-date-to-timezone($arg as xs:date?) as xs:date?
fn:adjust-date-to-timezone($arg as xs:date?, $timezone as xdt:dayTimeDuration?) as xs:date?
fn:adjust-time-to-timezone($arg as xs:time?) as xs:time?
fn:adjust-time-to-timezone($arg as xs:time?, $timezone as xdt:dayTimeDuration?) as xs:time?
fn-bea:add-timezone-to-dateTime($arg as xs:dateTime) as xs:dateTime
fn-bea:add-timezone-to-dateTime($arg as xs:dateTime, $duration as xs:dayTimeDuration) as xs:dateTime
fn-bea:remove-timezone-from-dateTime($arg as xs:dateTime) as xs:dateTime
fn-bea:remove-timezone-from-dateTime($arg as xs:dateTime, $duration as xs:dayTimeDuration) as xs:dateTime
fn-bea:add-timezone-to-date($arg as xs:date) as xs:date
fn-bea:add-timezone-to-date($arg as xs:date, $duration as xs:dayTimeDuration) as xs:date
fn-bea:add-timezone-to-time($arg as xs:time) as xs:time
fn-bea:add-timezone-to-time($arg as xs:time, $duration as xs:dayTimeDuration) as xs:time
fn-bea:remove-timezone-from-time($arg as xs:time) as xs:time
fn-bea:remove-timezone-from-time($arg as xs:time, $duration as xs:dayTimeDuration) as xs:time
fn:resolve-QName($qname as xs:string?, $element as element()) as xs:QName?
fn:expanded-QName($paramURI as xs:string?, $paramQName as xs:string) as xs:QName
fn:local-name-from-QName($arg as xs:QName?) as xs:NCNAME?
fn:namespace-uri-from-QName($arg as xs:QName?) as xs:anyURI?
fn:namespace-uri-for-prefix($prefix as xs:string, $element as element()) as xs:anyURI?
fn:in-scope-prefixes($element as element()) as xs:string*
fn:name($arg as node()?) as xs:string
fn:local-name($arg as node()?) as xs:string
fn:namespace-uri($arg as node()?) as xs:anyURI
fn:number($arg as xdt:anyAtomicType?) as xs:double
fn:lang($testlang as xs:string?, $node as node()) as xs:boolean
fn:root($arg as node()?) as node()?
fn:boolean($arg as item()*) as xs:boolean
op:concatenate($seq1 as item()*, $seq2 as item()*) as item()*
fn:index-of($seqParam as xdt:anyAtomicType*, $srchParam as xdt:anyAtomicType) as xs:integer*
fn:index-of($seqParam as xdt:anyAtomicType*, $srchParam as xdt:anyAtomicType, $collation as xs:string) as xs:integer*
fn:empty($arg as item()*) as xs:boolean
fn:exists($arg as item()*) as xs:boolean
fn:distinct-values($arg as xdt:anyAtomicType*) as xdt:anyAtomicType*
fn:distinct-values($arg as xdt:anyAtomicType*, $collation as xs:string) as xdt:anyAtomicType*
fn:insert-before($target as item()*, $position as xs:integer, $inserts as item()*) as item()*
fn:remove($target as item()*, $position as xs:integer) as item()*
fn:reverse($arg as item()*) as item()*
fn:subsequence($sourceSeq as item()*, $startingLoc as xs:double) as item()*
fn:subsequence($sourceSeq as item()*, $startingLoc as xs:double, $length as xs:double) as item()*
fn:zero-or-one($arg as item()*) as item()?
fn:one-or-more($arg as item()*) as item()+
fn:exactly-one($arg as item()*) as item()
fn:deep-equal($parameter1 as item()*, $parameter2 as item()*) as xs:boolean
fn:deep-equal($parameter1 as item()*, $parameter2 as item()*, $collation as string) as xs:boolean
fn:count($arg as item()*) as xs:integer
fn:avg($arg as xdt:anyAtomicType*) as xdt:anyAtomicType?
fn:max($arg as xdt:anyAtomicType*) as xdt:anyAtomicType?
fn:max($arg as xdt:anyAtomicType*, $collation as string) as xdt:anyAtomicType?
fn:min($arg as xdt:anyAtomicType*) as xdt:anyAtomicType?
fn:min($arg as xdt:anyAtomicType*, $collation as string) as xdt:anyAtomicType?
fn:sum($arg as xdt:anyAtomicType*) as xdt:anyAtomicType
fn:sum($arg as xdt:anyAtomicType*, $zero as xdt:anyAtomicType?) as xdt:anyAtomicType?
fn-bea:integer-sequence($seq as node()*) as integer*
fn:doc($uri as xs:string?) as document-node()?
fn:position() as xs:integer
fn:last() as xs:integer
fn:current-dateTime() as xs:dateTime
fn:current-date() as xs:date
fn:current-time() as xs:time
fn:implicit-timezone() as xdt:dayTimeDuration
fn:default-collation() as xs:string
fn-bea:execute-sql($datasource as xs:string, $rowElemName as xdt:anyAtomicType, $sql as xs:string, $params...) as element()*