Re: [Architecture] WSO2 Identity Server 5.4.0 Alpha 9 Released !!!

2017-11-22 Thread Farasath Ahamed
Hi Tharindu,

I downloaded the alpha9 tag
https://github.com/wso2/product-is/tree/v5.4.0-alpha9 and built it skipping
the tests without any problem.

*Java version*
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

*Maven Version*
Apache Maven 3.0.5
Maven home: /usr/share/maven
Java version: 1.8.0_144, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-113-generic", arch: "amd64", family:
"unix"


Could this be due to maven/java version difference?

Farasath Ahamed
Software Engineer, WSO2 Inc.; http://wso2.com
Mobile: +94777603866
Blog: blog.farazath.com
Twitter: @farazath619 




On Thu, Nov 23, 2017 at 12:10 PM, Tharindu Edirisinghe 
wrote:

> Hi Devs,
>
> I tried to build the IS 5.4.0 alpha9 and when I build the v5.4.0-alpha9
> tag in product-is skipping the tests, I got the following error.
>
> [INFO] 
> 
> [INFO] BUILD FAILURE
> [INFO] 
> 
> [INFO] Total time: 1.215 s
> [INFO] Finished at: 2017-11-23T11:33:53+05:30
> [INFO] Final Memory: 45M/1237M
> [INFO] 
> 
> [ERROR] Failed to execute goal org.apache.maven.plugins:
> maven-remote-resources-plugin:1.5:process (default) on project
> identity-server-parent: Error finding remote resources manifests:
> /home/tharindu/Desktop/alpha9/product-is/target/maven-
> shared-archive-resources/META-INF/NOTICE (No such file or directory) ->
> [Help 1]
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute
> goal org.apache.maven.plugins:maven-remote-resources-plugin:1.5:process
> (default) on project identity-server-parent: Error finding remote resources
> manifests
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(
> MojoExecutor.java:212)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(
> MojoExecutor.java:153)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(
> MojoExecutor.java:145)
> at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.
> buildProject(LifecycleModuleBuilder.java:116)
> at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.
> buildProject(LifecycleModuleBuilder.java:80)
> at org.apache.maven.lifecycle.internal.builder.singlethreaded.
> SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
> at org.apache.maven.lifecycle.internal.LifecycleStarter.
> execute(LifecycleStarter.java:128)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
> at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
> at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:62)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:497)
> at org.codehaus.plexus.classworlds.launcher.Launcher.
> launchEnhanced(Launcher.java:289)
> at org.codehaus.plexus.classworlds.launcher.Launcher.
> launch(Launcher.java:229)
> at org.codehaus.plexus.classworlds.launcher.Launcher.
> mainWithExitCode(Launcher.java:415)
> at org.codehaus.plexus.classworlds.launcher.Launcher.
> main(Launcher.java:356)
> Caused by: org.apache.maven.plugin.MojoExecutionException: Error finding
> remote resources manifests
> at org.apache.maven.plugin.resources.remote.
> ProcessRemoteResourcesMojo.processResourceBundles(
> ProcessRemoteResourcesMojo.java:1238)
> at org.apache.maven.plugin.resources.remote.
> ProcessRemoteResourcesMojo.execute(ProcessRemoteResourcesMojo.java:520)
> at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(
> DefaultBuildPluginManager.java:134)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(
> MojoExecutor.java:207)
> ... 20 more
> Caused by: java.io.FileNotFoundException: 
> /home/tharindu/Desktop/alpha9/*product-is/target/maven-shared-archive-resources/META-INF/NOTICE
> (No such file or directory)*
> at java.io.FileOutputStream.open0(Native Method)
> at java.io.FileOutputStream.open(FileOutputStream.java:270)
> at java.io.FileOutputStream.(FileOutputStream.java:213)
> at java.io.FileOutputStream.(FileOutputStream.java:162)
> at java.io.FileWriter.(FileWriter.java:90)
> at org.apache.maven.plugin.resources.remote.
> 

Re: [Architecture] Workday Connector

2017-11-22 Thread Isuru Udana
Hi Nirthika,

In the following Callout mediator configuration, target is set to a
property called 'response'. In that case response is not set to the
envelope of the message context.



To send a response back to the client we need to set the response payload
received from the Callout operation into the envelope of the message
context.
Please try with following configuration.

http://schemas.xmlsoap.org/soap/envelope/;
xmlns:s12="http://www.w3.org/2003/05/soap-envelope;
xpath="s11:Body/child::*[fn:position()=1] |
s12:Body/child::*[fn:position()=1]"/>

Thanks.

On Tue, Nov 21, 2017 at 4:02 PM, Nirthika Rajendran 
wrote:

> Hi All,
>
> I resolve the above issue for blocking mode by giving callout (without
> giving "target" [1]) and send mediator as below
>
> 
>
> 
>
> 
>
> 
> 
> 
>  
>
> Now I can get the response and all operations of workday connector are
> working fine.
> But when testing with EI tooling I got the error "The message 'target'
> must be specified for a Callout mediator".
> Please give any sollution for this
>
> Reference
>
> https://madurangasiriwardena.wordpress.com/2017/03/24/dynamically-set-the-
> credentials-to-invoke-username-token-secured-
> backend-service-using-wso2esb/
>
> https://docs.wso2.com/display/EI611/Callout+Mediator
>
> [1] http://hastef88.github.io/2016/01/19/synchronous-jms-
> publishing-with-wso2-esb-481-and-wso2-mb-300/
>
> Regards,
> *Nirthika Rajendran*
> *Associate Software Engineer*
> WSO2 Inc : http://wso2.org
> Mobile   : +94 77 719 8368 <077%20719%208368>
> LinkedIn: https://www.linkedin.com/in/nirthika/
> Blog  :
> *http://nirthika-tech-stuff.blogspot.com/
> *
>
> On Mon, Nov 20, 2017 at 11:41 AM, Nirthika Rajendran 
> wrote:
>
>> Hi All,
>>
>> Thanks Thishani. Yes that's not an error. For now I can ignore it.
>> As in the [1] I disable the chunking in axis2_blocking_client.xml as
>> follows
>> >  class="org.apache.axis2.trans
>> port.http.CommonsHTTPTransportSender">
>> HTTP/1.1
>> none
>> true
>> 200
>> 
>>
>> Then I don't get the above error.
>> Now for the blocking mode response come to EI but not send the message
>> back to the client.
>> The Error is
>>
>> HTTP/1.1 500 Internal Server Error
>>
>> Body consist
>> http://schemas
>> .xmlsoap.org/soap/envelope/">
>>
>>   
>>  SOAP-ENV:Client.authenticationError
>>  invalid username or password
>>   
>>
>> 
>>
>> [1] https://docs.wso2.com/display/EI611/Callout+Mediator
>>
>> Regards,
>> *Nirthika Rajendran*
>> *Associate Software Engineer*
>> WSO2 Inc : http://wso2.org
>> Mobile   : +94 77 719 8368 <+94%2077%20719%208368>
>> LinkedIn: https://www.linkedin.com/in/nirthika/
>> Blog  :
>> *http://nirthika-tech-stuff.blogspot.com/
>> *
>>
>> On Mon, Nov 20, 2017 at 9:08 AM, Thishani Lucas 
>> wrote:
>>
>>> Hi Nirthika,
>>>
>>> I guess the TimeoutHandler message is not actually an error. It
>>> shouldn't cause any issues because it's just getting logged when the
>>> blocking message sender is invoked inside the call-out mediator.
>>>
>>> Thanks.
>>>
>>> On Sun, Nov 19, 2017 at 7:29 PM, Nirthika Rajendran 
>>> wrote:
>>>
 Hi All,

 In the workday connector implementation username-token is used for the
 authentication. Accoding to [1] for the blocking mode I use callout
 mediator [2] as below.

 

 

 

 

 
 

 But I am getting "Error in extracting message properties" and
 "TimeoutHandler This engine will expire all callbacks after GLOBAL_TIMEOUT:
 120 seconds, irrespective of the timeout action, after the specified or
 optional timeout"
 Please give some suggestion on this

 [1] https://madurangasiriwardena.wordpress.com/2017/03/24/dynami
 cally-set-the-credentials-to-invoke-username-token-secured-b
 ackend-service-using-wso2esb/
 [2] https://docs.wso2.com/display/EI611/Callout+Mediator


 Regards,
 *Nirthika Rajendran*
 *Associate Software Engineer*
 WSO2 Inc : http://wso2.org
 Mobile   : +94 77 719 8368 <+94%2077%20719%208368>
 LinkedIn: https://www.linkedin.com/in/nirthika/
 Blog  :
 *http://nirthika-tech-stuff.blogspot.com/
 *

 On Wed, Nov 1, 2017 at 10:05 AM, Nirthika Rajendran 
 wrote:

> Hi All,
>
> Please find the PR [1] and Documentation [2] for Workday connector.
>
> [1] https://github.com/wso2-extensions/esb-connector-workday/pull/1
> [2] https://docs.wso2.com/display/ESBCONNECTORS/Workday+Connector
>
> Regards,
> *Nirthika Rajendran*
> *Associate Software Engineer*
> WSO2 Inc : http://wso2.org
> Mobile   : +94 77 719 8368 <+94%2077%20719%208368>
> 

Re: [Architecture] Proposed Key Schema for LevelDB Store of Message Broker

2017-11-22 Thread Wishmitha Mendis
Hi all, A File-Based DTX store was implemented using LevelDB to store
distributed transaction related data. As XA transaction (two-phase commit)
is used to handle the distributed transaction in MB, the related xid along
with node id and branch id should be stored. Each transaction consists of
message enqueue/dequeue (or both) operations. In the prepare phase of the
transaction, metadata and the content of the messages which should be
enqueued/dequeued have to be stored temporarily. When the transaction is in
the commit phase, enqueue/dequeue operations of the transaction should be
committed and temporary records during the prepare phase should be deleted.
LevelDB WriteBatch[1] was used to implement these operations.

Following is the key schema for the DTX Store. These keys are defined to
hold the related data temporary in the prepare phase of the transaction.

Key Schema :

Key

Value

DTX_ENTRY : $xid: $node_id : BRANCH_ID

Branch ID

DTX_ENTRY : $xid : $node_id : FORMAT_CODE

Format code

DTX_ENTRY : $xid : $node_id : GLOBAL_ID

Global ID

DTX_ENQUEUE : $xid : MESSAGE_METADATA : $message_id

Metadata of the message which should be enqueued

DTX_ENQUEUE : $xid : MESSAGE_CONTENT : $message_id : $offset

Content chunk of the message which should be enqueued

DTX_DEQUEUE : $xid : MESSAGE_METADATA : $message_id

Metadata of the message which should be dequeued

DTX_DEQUEUE : $xid :  MESSAGE_CONTENT : $message_id : $offset

Content chunk of the message which should be dequeued

DTX_DEQUEUE : $xid : DESTINATION_NAME : $message_id

Destination of the message which should be dequeued

Implementation :

The implementation of the file based DTX Store is done by implementing
methods in DtxStore interface.[2]


[1]https://github.com/google/leveldb/blob/master/doc/index.md#atomic-updates
[2] Pull Request :  https://github.com/wso2/andes/pull/944/files

Best Regards,

On Fri, Nov 10, 2017 at 11:53 AM, Wishmitha Mendis 
wrote:

> Hi all,
>
> The key schema for LevelDB store was updated due to following reasons.
>
>1.
>
>Reduce data replication
>2.
>
>Minimize the lookup time for iterators when retrieving data
>
>
> When updating the schema lexicographically ordered storage mechanism of
> LevelDB was taken into consideration.
>
> Updated Key Schema :
>
> Key
>
> Value
>
> MESSAGE.$message_id.$content_offset.MESSAGE_CONTENT
>
> Message content chunk
>
> MESSAGE.$message_id.DESTINATION_NAME
>
> Name of the queue/topic where the message is stored
>
> MESSAGE.$message_id.DLC_STATUS
>
> “1” if the message is in dead letter channel, else “0”
>
> DESTINATION.MESSAGE_COUNT.$destination_name
>
> Message count of the queue/topic
>
> DESTINATION.$destination_name.MESSAGE_METADATA.$message_id
>
> Metadata of the message which is stored in the queue/topic.
>
> DESTINATION.$destination_name.MESSAGE_EXPIRATION_TIME.$message_id
>
> Expiration time of the message which is stored in the queue/topic.
>
> Comparison :
>
> When compared to the previous schema, this schema has less data
> repetition. Previously, the message metadata and expiration time were
> stored both under the message and the destination, whereas in this schema
> metadata and expiration time are stored only under the destination.
>
> Attributes like QUEUE_ID, DLC_QUEUE_ID were removed from the schema, as
> all the queues/topics are guaranteed to have a unique name.
>
> In the previous key schema, metadata and expiration time of a message in a
> destination were stored successively.
>
> [image: Screenshot from 2017-11-10 10-58-12.png]
>
> With this schema, when an iterator looks up for all message metadata in a
> destination, it will have to traverse through all the keys including the
> keys related to expiration time as well. This lookup time can be reduced by
> separating expiration time and message metadata as follows.
>
> [image: Screenshot from 2017-11-10 11-06-40.png]
>
> Now the iterator does not have to traverse through expiration time related
> keys as they are separated from the message metadata related keys. This is
> used in the updated schema. Hence the lookup time for both metadata and
> expiration time will be halved compared to the previous schema.
>
> As the total number of keys per message is reduced in this schema,
> publisher rates will be increased too.
>
> Dead Letter Channel :
>
> Dead letter channel is considered as a destination(queue) where messages
> will be moved to it, once the maximum redelivery attempts are reached. The 
> DLC_STATUS
> of the message will be updated from "0" to “1”, once the message is moved
> to the dead letter channel.
>
> On Wed, Aug 16, 2017 at 5:24 PM, Hasitha Hiranya 
> wrote:
>
>> Hi Asanka and all,
>>
>> On Wed, Aug 16, 2017 at 12:08 PM, Asanka Abeyweera 
>> wrote:
>>
>>> Hi Wishmitha,
>>>
>>> On Tue, Aug 15, 2017 at 5:34 PM, Wishmitha Mendis 
>>> wrote:
>>>
 Hi Asanka,


Re: [Architecture] Workday Connector

2017-11-22 Thread Nirthika Rajendran
Hi Isuru,

I use the target configuration as you mentioned. Now it works fine in EI
tooling also.
Thanks for the solution.

Regards,
*Nirthika Rajendran*
*Associate Software Engineer*
WSO2 Inc : http://wso2.org
Mobile   : +94 77 719 8368
LinkedIn: https://www.linkedin.com/in/nirthika/
Blog  :
*http://nirthika-tech-stuff.blogspot.com/
*

On Wed, Nov 22, 2017 at 1:57 PM, Isuru Udana  wrote:

> Hi Nirthika,
>
> In the following Callout mediator configuration, target is set to a
> property called 'response'. In that case response is not set to the
> envelope of the message context.
>
> 
>
> To send a response back to the client we need to set the response payload
> received from the Callout operation into the envelope of the message
> context.
> Please try with following configuration.
>
> http://schemas.xmlsoap.org/soap/envelope/;
> xmlns:s12="http://www.w3.org/2003/05/soap-envelope;
> xpath="s11:Body/child::*[fn:position()=1] |
> s12:Body/child::*[fn:position()=1]"/>
>
> Thanks.
>
> On Tue, Nov 21, 2017 at 4:02 PM, Nirthika Rajendran 
> wrote:
>
>> Hi All,
>>
>> I resolve the above issue for blocking mode by giving callout (without
>> giving "target" [1]) and send mediator as below
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>> 
>> 
>>  
>>
>> Now I can get the response and all operations of workday connector are
>> working fine.
>> But when testing with EI tooling I got the error "The message 'target'
>> must be specified for a Callout mediator".
>> Please give any sollution for this
>>
>> Reference
>>
>> https://madurangasiriwardena.wordpress.com/2017/03/24/dynami
>> cally-set-the-credentials-to-invoke-username-token-secured-
>> backend-service-using-wso2esb/
>>
>> https://docs.wso2.com/display/EI611/Callout+Mediator
>>
>> [1] http://hastef88.github.io/2016/01/19/synchronous-jms-publish
>> ing-with-wso2-esb-481-and-wso2-mb-300/
>>
>> Regards,
>> *Nirthika Rajendran*
>> *Associate Software Engineer*
>> WSO2 Inc : http://wso2.org
>> Mobile   : +94 77 719 8368 <077%20719%208368>
>> LinkedIn: https://www.linkedin.com/in/nirthika/
>> Blog  :
>> *http://nirthika-tech-stuff.blogspot.com/
>> *
>>
>> On Mon, Nov 20, 2017 at 11:41 AM, Nirthika Rajendran 
>> wrote:
>>
>>> Hi All,
>>>
>>> Thanks Thishani. Yes that's not an error. For now I can ignore it.
>>> As in the [1] I disable the chunking in axis2_blocking_client.xml as
>>> follows
>>> >>  class="org.apache.axis2.trans
>>> port.http.CommonsHTTPTransportSender">
>>> HTTP/1.1
>>> none
>>> true
>>> 200
>>> 
>>>
>>> Then I don't get the above error.
>>> Now for the blocking mode response come to EI but not send the message
>>> back to the client.
>>> The Error is
>>>
>>> HTTP/1.1 500 Internal Server Error
>>>
>>> Body consist
>>> http://schemas
>>> .xmlsoap.org/soap/envelope/">
>>>
>>>   
>>>  SOAP-ENV:Client.authenticationError
>>>  invalid username or password
>>>   
>>>
>>> 
>>>
>>> [1] https://docs.wso2.com/display/EI611/Callout+Mediator
>>>
>>> Regards,
>>> *Nirthika Rajendran*
>>> *Associate Software Engineer*
>>> WSO2 Inc : http://wso2.org
>>> Mobile   : +94 77 719 8368 <+94%2077%20719%208368>
>>> LinkedIn: https://www.linkedin.com/in/nirthika/
>>> Blog  :
>>> *http://nirthika-tech-stuff.blogspot.com/
>>> *
>>>
>>> On Mon, Nov 20, 2017 at 9:08 AM, Thishani Lucas 
>>> wrote:
>>>
 Hi Nirthika,

 I guess the TimeoutHandler message is not actually an error. It
 shouldn't cause any issues because it's just getting logged when the
 blocking message sender is invoked inside the call-out mediator.

 Thanks.

 On Sun, Nov 19, 2017 at 7:29 PM, Nirthika Rajendran 
 wrote:

> Hi All,
>
> In the workday connector implementation username-token is used for the
> authentication. Accoding to [1] for the blocking mode I use callout
> mediator [2] as below.
>
> 
>
> 
>
> 
>
> 
>
> 
> 
>
> But I am getting "Error in extracting message properties" and
> "TimeoutHandler This engine will expire all callbacks after 
> GLOBAL_TIMEOUT:
> 120 seconds, irrespective of the timeout action, after the specified or
> optional timeout"
> Please give some suggestion on this
>
> [1] https://madurangasiriwardena.wordpress.com/2017/03/24/dynami
> cally-set-the-credentials-to-invoke-username-token-secured-b
> ackend-service-using-wso2esb/
> [2] https://docs.wso2.com/display/EI611/Callout+Mediator
>
>
> Regards,
> *Nirthika Rajendran*
> *Associate Software Engineer*
> WSO2 Inc : http://wso2.org
> Mobile   : +94 77 719 8368 <+94%2077%20719%208368>
> LinkedIn: