osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discussion] Fineract CN SMS & Email Notifications Project


Thanks for the insights into the email connection timeout error.

This is the correct log for the Service Exception:
https://pastebin.com/WsQLPmwf  <https://pastebin.com/WsQLPmwf>. My best
guess is that the identity service did not create the application request
when I called it. I wanted to find out how rhythm handles that aspect but
realized that rhythm checks and requests for permission before sending a
beat. But all of this is after initialization of the demo server. (So I was
actually wondering how it registers the permission) I created a request
helper method in the demo-server to help me request permission for the
customer service however, I believe this is not working as it should.
<https://pastebin.com/WsQLPmwf>


Also, I run the demo server on a cloud VM. I would love to connect my
IntelliJ IDE to the build. How should I approach this?


*At your service,*

*Ebenezer Graham*

*BSc (Hons) Computing*


[image: EmailSignature.png]

African Leadership University,

Power Mill Road, Pamplemousses,

Mauritius.


*skype*:
ebenezer.graham
GitHub <https://github.com/ebenezergraham> | LinkedIn
<https://www.linkedin.com/in/ebenezer-graham/> | Twitter
<https://twitter.com/pactmart> | Facebook
<https://www.facebook.com/pactmart>
www.pactmart.com | Freelancing made easy.


*“Talk is cheap, show me the code.” *- *Linus Torvalds*




On Sun, 7 Oct 2018 at 21:40, Myrle Krantz <myrle@xxxxxxxxxx> wrote:

> Hey Ebenezer,
>
> Here are the 5 lines you put into pastebin:
>
> 12:28:48.386 [DefaultMessageListenerContainer-1] DEBUG
> notification-logger - customerActivatedEvent has been invoked
> 12:28:48.566 [DefaultMessageListenerContainer-1] DEBUG
> notification-logger - sendSMS invoked
> 12:30:55.867 [DefaultMessageListenerContainer-1] DEBUG
> notification-logger - Caused
> by:com.sun.mail.util.MailConnectException: Couldn't connect to host,
> port: smtp.gmail.com, 587; timeout -1;
>   nested exception is:
>     java.net.ConnectException: Connection timed out (Connection timed out)
>
> Based on those it looks like sms was successful, and then mail sending
> failed.  But with so little context I can only make wild guesses at
> the reason.  However I did recently check something in which could
> help you debug the problem yourself.  Pull the latest from demo-server
> and service-starter.  Then start demo-server with the parameter
> runInDebug set to true (-Ddemoserver.runInDebug=true).  Once
> demoServer is started, you can use your development environment to
> connect to the running service.  I'm not sure whether you are using
> IntelliJ or Eclipse, the process will be different depending which one
> you're using.
>
> Once your dev environment is connected to the process you can set
> break points and try to debug what's going on.  In particular, you can
> examine that exception for more information, and figure out where in
> the call stack it is coming from.
>
> I doubt this has anything to do with the Fineract CN security though.
> That shouldn't effect calls outside of Fineract CN.
>
> Best Regards,
> Myrle
>
> On Mon, Aug 27, 2018 at 6:03 PM Ebenezer Graham
> <egraham15@xxxxxxxxxxxxxx> wrote:
> >
> > Hi all,
> >
> > I am having a connection issue with the java mail.  https://pastebin.com
> > /f8UAkvsa
> >
> > I can send emails when I run it from the component test but the
> connection
> > times out when the service is started by the demo-server. The SMS service
> > works fine and only the email service times out.
> >
> > Does anyone have ideas on how to solve this? I have tried a lot of
> > solutions on the web but I believe that this timeout is caused by
> security
> > constraints in Fineract CN
> >
> > *At your service,*
> >
> > *Ebenezer Graham*
> >
> > *BSc (Hons) Computing*
> >
> >
> > [image: EmailSignature.png]
> >
> > African Leadership University,
> >
> > Power Mill Road, Pamplemousses,
> >
> > Mauritius.
> >
> >
> >
> > *skype*:
> > ebenezer.graham
> > GitHub <https://github.com/ebenezergraham> | LinkedIn
> > <https://www.linkedin.com/in/ebenezer-graham/> | Twitter
> > <https://twitter.com/pactmart> | Facebook
> > <https://www.facebook.com/pactmart>
> > www.pactmart.com | Freelancing made easy.
> >
> >
> > *“Talk is cheap, show me the code.” *- *Linus Torvalds*
> >
> >
> >
> > On 23 August 2018 at 18:05, Ebenezer Graham <egraham15@xxxxxxxxxxxxxx>
> > wrote:
> >
> > > Hi all,
> > >
> > > @Markus: The ActiveMQ configuration worked :). I am now getting one
> > > invocation. Thanks for the support,
> > >
> > > However, the entity creation is still not working but I think Myrle's
> > > feedback on my PR might do the trick.
> > >
> > > @Myrle: I have updated the private cwiki page with the credentials,
> > > thanks. Also, I have incorporated most of the feedback shared on the
> PRs
> > > and added a few comments.
> > > For the Domain objects, I have created tests for each of them. I will
> add
> > > more rigorous tests to it after making significant progress with the
> > > web-app interface
> > > and the connection timeout problem when the system is up. More about
> the
> > > issue below
> > > The issue has to do with service timeouts.
> https://pastebin.com/f8UAkvsa
> > > *N*
> > > * B: *the email and SMS services are correctly configured and do send
> out
> > > emails and SMS
> > > in the component test. However, when I make an actual build the mail
> > > connection times out even though it
> > > has been invoked
> > >
> > > @Awasum like you suggested, I have changed the JavaMail version to
> 1.4.1
> > > RELEASE and it works fine. Thanks
> > > I have created values in the ext.versions for the Twilio API and
> > > JavaMail in the shared.gradle
> > >
> > > My best guess is that there is something interrupting or inhibiting the
> > > connection when the entire system is
> > > up and running.
> > >
> > > Looking forward to your feedback.
> > >
> > > On 22 August 2018 at 16:03, Markus Geiss <markus.geiss@xxxxxxxxx>
> wrote:
> > >
> > >> Hey Ebenezer,
> > >>
> > >> hope this finds you well. (;
> > >>
> > >> looking at the two stack traces you've provided here is my take on it.
> > >>
> > >> The error while storing configuration is caused by a field in the
> database
> > >> 'sender_number' being declared as not null, but no data is provided.
> In
> > >> the
> > >> create method of SMSConfiguration you are not handling the sender
> number
> > >> at
> > >> all. I would recommend to either use a builder pattern or just use
> plain
> > >> getter/setter to create the instance.
> > >>
> > >> With regards to receiving multiple (3) events, this is caused by the
> way
> > >> acitvemq is configured in your service. The default
> > >> for activemq.concurrency is 3-10, if you set this to 1-1 it will only
> > >> listen with 1 concurrent thread.
> > >>
> > >> Hope this helps.
> > >>
> > >> Cheers
> > >>
> > >> Markus
> > >>
> > >>
> > >>
> > >> On Wed, Aug 22, 2018 at 1:40 PM Ebenezer Graham <
> egraham15@xxxxxxxxxxxxxx
> > >> >
> > >> wrote:
> > >>
> > >> > Thanks myrle,
> > >> >
> > >> > I have already created a demo email account called
> > >> > fineractcnnotificationdemo@xxxxxxxxx and I created it for the sole
> > >> purpose
> > >> > of testing emails for this service and for other contributors to
> use.
> > >> > Please advise me on this approach.
> > >> >
> > >> > Also, the password for ebenezergraham69@xxxxxxxxx and
> akyencorp@gmail
> > >> are
> > >> > no longer valid. I created app passwords and so I have already
> deleted
> > >> > those app passwords for my live account and are no longer valid.
> > >> >
> > >> > *Error:*
> > >> > In an attempt to store configurations from the repository I get this
> > >> error:
> > >> > https://pastebin.com/WqvRwXvB
> > >> >
> > >> > Please check: shouldCreateSMSConfigurationEntity()
> > >> > https://github.com/ebenezergraham/fineract-cn-notifications/
> > >> > blob/develop/component-test/src/main/java/org/apache/
> > >> > fineract/cn/notification/TestSMSService.java
> > >> >
> > >> > I am able to retrieve stored configurations but I am unable to
> create a
> > >> > configuration and store. Same issue for email repository
> > >> >
> > >> > Second Issue: https://pastebin.com/LKz7HcGy
> > >> > I have managed to authenticate with identity and getting customer
> > >> object,
> > >> > however, when I trigger an invent from the fims web app, I get 3
> > >> > invocations from the ActiveMQ. How can I resolve this issue? Are my
> > >> > assumptions correct to begin with?
> > >> >
> > >> >
> > >> > *At your service,*
> > >> >
> > >> > *Ebenezer Graham*
> > >> >
> > >> > *BSc (Hons) Computing*
> > >> >
> > >> >
> > >> > [image: EmailSignature.png]
> > >> >
> > >> > African Leadership University,
> > >> >
> > >> > Power Mill Road, Pamplemousses,
> > >> >
> > >> > Mauritius.
> > >> >
> > >> >
> > >> >
> > >> > *skype*:
> > >> > ebenezer.graham
> > >> > GitHub <https://github.com/ebenezergraham> | LinkedIn
> > >> > <https://www.linkedin.com/in/ebenezer-graham/> | Twitter
> > >> > <https://twitter.com/pactmart> | Facebook
> > >> > <https://www.facebook.com/pactmart>
> > >> > www.pactmart.com | Freelancing made easy.
> > >> >
> > >> >
> > >> > *“Talk is cheap, show me the code.” *- *Linus Torvalds*
> > >> >
> > >> >
> > >> >
> > >> > On 22 August 2018 at 15:10, Ebenezer Graham <
> egraham15@xxxxxxxxxxxxxx>
> > >> > wrote:
> > >> >
> > >> > > Thanks myrle,
> > >> > >
> > >> > > I have already created a demo email account called
> > >> > > fineractcnnotificationdemo@xxxxxxxxx and I created it for the
> sole
> > >> > > purpose of testing emails for this service and for other
> contributors
> > >> > > to use. Please advise me on this approach.
> > >> > >
> > >> > > Also, the password for ebenezergraham69@xxxxxxxxx and
> akyencorp@gmail
> > >> > are
> > >> > > not the real passwords. I created app passwords and so I have
> already
> > >> > > deleted those app passwords for my live account and are no longer
> > >> valid.
> > >> > >
> > >> > > *Error:*
> > >> > > In an attempt to store configurations from the repository I get
> this
> > >> > error:
> > >> > >
> > >> > > Please check: shouldCreateSMSConfigurationEntity()
> > >> > >
> > >> > https://github.com/ebenezergraham/fineract-cn-notifications/
> > >> blob/develop/
> > >> > > component-test/src/main/java/org/apache/fineract/cn/
> > >> > > notification/TestSMSService.java
> > >> > >
> > >> > > I am able to retrieve stored configurations but I am unable to
> create
> > >> a
> > >> > > configuration and store. Same issue for email repository
> > >> > >
> > >> > > Second Issue: https://pastebin.com/LKz7HcGy
> > >> > > I have managed to authenticate with identity and getting customer
> > >> object,
> > >> > > however, when I trigger an invent from the fims web app, I get 3
> > >> > > invocations from the ActiveMQ. How can I resolve this issue? Are
> my
> > >> > > assumptions correct to begin with?
> > >> > >
> > >> > >
> > >> > > *At your service,*
> > >> > >
> > >> > > *Ebenezer Graham*
> > >> > >
> > >> > > *BSc (Hons) Computing*
> > >> > >
> > >> > >
> > >> > > [image: EmailSignature.png]
> > >> > >
> > >> > > African Leadership University,
> > >> > >
> > >> > > Power Mill Road, Pamplemousses,
> > >> > >
> > >> > > Mauritius.
> > >> > >
> > >> > >
> > >> > >
> > >> > > *skype*:
> > >> > > ebenezer.graham
> > >> > > GitHub <https://github.com/ebenezergraham> | LinkedIn
> > >> > > <https://www.linkedin.com/in/ebenezer-graham/> | Twitter
> > >> > > <https://twitter.com/pactmart> | Facebook
> > >> > > <https://www.facebook.com/pactmart>
> > >> > > www.pactmart.com | Freelancing made easy.
> > >> > >
> > >> > >
> > >> > > *“Talk is cheap, show me the code.” *- *Linus Torvalds*
> > >> > >
> > >> > >
> > >> > >
> > >> > > On 22 August 2018 at 14:45, Myrle Krantz <myrle@xxxxxxxxxx>
> wrote:
> > >> > >
> > >> > >> Hey Ebenezer,
> > >> > >>
> > >> > >> I was just reviewing your PR and realized that you had included
> > >> > >> passwords in it.  They look like they might be passwords to live
> > >> > >> accounts.  I strongly suggest you remove them from your latest
> PR.
> > >> > >>
> > >> > >> I also checked and it appears you have passwords in code that has
> > >> > >> already been merged.  If this is true, I suggest you change the
> > >> > >> password on the e-mail account: ebenezergraham69@xxxxxxxxx
> > >> > >>
> > >> > >> In general, we don't change git history.  It's okay to make
> mistakes,
> > >> > >> and it's important to preserve the commit history of a project.
> > >> There
> > >> > >> are few exceptions I would make, but one of those is for
> passwords or
> > >> > >> other secrets.  But only if those passwords or other secrets
> can't
> > >> > >> easily be replaced.  I don't believe this is the case here.
> > >> > >>
> > >> > >> Beyond that, I'm working on putting together feedback on your
> code
> > >> and
> > >> > >> will post that by the end of the day.
> > >> > >>
> > >> > >> Best Regards,
> > >> > >> Myrle
> > >> > >>
> > >> > >>
> > >> > >>
> > >> > >>
> > >> > >> On Wed, Aug 22, 2018 at 9:12 AM Ebenezer Graham
> > >> > >> <egraham15@xxxxxxxxxxxxxx> wrote:
> > >> > >> >
> > >> > >> > Hi Awasum,
> > >> > >> >
> > >> > >> > I have been able to resolve the authentication problem and now
> > >> able to
> > >> > >> > retrieve customers.
> > >> > >> >
> > >> > >> > I have also written a component test for the email and sms
> service.
> > >> > >> >
> > >> > >> > In an attempt to clean up my repository and squash the commits
> I
> > >> > messed
> > >> > >> up
> > >> > >> > my repo hence I have deleted it and forked a new one.
> > >> > >> >
> > >> > >> > In light of this, would like to find out if it is possible to
> force
> > >> > >> merge
> > >> > >> > them so that apache repository takes commits from mine.  This
> is
> > >> > because
> > >> > >> > the one on Apache has some unwanted files such as the sample
> > >> classes
> > >> > and
> > >> > >> > travis.yml. Please let me know if this is possible.
> > >> > >> >
> > >> > >> > Also, I have made new PRs. Please review it and provide
> feedback
> > >> > >> >
> > >> > >> > Looking forward to your response.
> > >> > >> >
> > >> > >> > *At your service,*
> > >> > >> >
> > >> > >> > *Ebenezer Graham*
> > >> > >> >
> > >> > >> > *BSc (Hons) Computing*
> > >> > >> >
> > >> > >> >
> > >> > >> > [image: EmailSignature.png]
> > >> > >> >
> > >> > >> > African Leadership University,
> > >> > >> >
> > >> > >> > Power Mill Road, Pamplemousses,
> > >> > >> >
> > >> > >> > Mauritius.
> > >> > >> >
> > >> > >> >
> > >> > >> >
> > >> > >> > *skype*:
> > >> > >> > ebenezer.graham
> > >> > >> > GitHub <https://github.com/ebenezergraham> | LinkedIn
> > >> > >> > <https://www.linkedin.com/in/ebenezer-graham/> | Twitter
> > >> > >> > <https://twitter.com/pactmart> | Facebook
> > >> > >> > <https://www.facebook.com/pactmart>
> > >> > >> > www.pactmart.com | Freelancing made easy.
> > >> > >> >
> > >> > >> >
> > >> > >> > *“Talk is cheap, show me the code.” *- *Linus Torvalds*
> > >> > >> >
> > >> > >> >
> > >> > >> >
> > >> > >> > On 9 July 2018 at 12:25, Awasum Yannick <awasum@xxxxxxxxxx>
> wrote:
> > >> > >> >
> > >> > >> > > Hello Graham,
> > >> > >> > >
> > >> > >> > > You need to create a user, maybe use *operator* and make
> sure the
> > >> > >> user has
> > >> > >> > > permission to access customer (READ). Then you have to
> create a
> > >> > class
> > >> > >> which
> > >> > >> > > uses this user to connect and authenticate each time with the
> > >> > identity
> > >> > >> > > service before each customer information is retrieved.
> > >> > >> > >
> > >> > >> > > This user could be defined in the yml file of your service
> and
> > >> then
> > >> > >> > > injected into the Authentication Class you create.
> > >> > >> > >
> > >> > >> > > Each event which is emitted most often has the tenant within
> the
> > >> > >> message.
> > >> > >> > > just get this tenant and check and set the
> *TenantContextHolder
> > >> *if
> > >> > >> not
> > >> > >> > > already set just before you authenticate. Immediately after
> > >> > >> authentication,
> > >> > >> > > Set the *UserContextHolder* too
> > >> > >> > >
> > >> > >> > > Another point is to remember to trim or remove the quotes
> from
> > >> the
> > >> > >> customer
> > >> > >> > > identifier before trying to get more contact details about
> that
> > >> > >> customer:
> > >> > >> > > {String}.replaceAll("^\"|\"$", "")
> > >> > >> > >
> > >> > >> > > I hope this helps
> > >> > >> > >
> > >> > >> > > Thanks.
> > >> > >> > > Awasum Yannick
> > >> > >> > >
> > >> > >> > > On Tue, Jul 3, 2018 at 11:18 PM Ebenezer Graham <
> > >> > >> egraham15@xxxxxxxxxxxxxx>
> > >> > >> > > wrote:
> > >> > >> > >
> > >> > >> > > > Hello there,
> > >> > >> > > >
> > >> > >> > > > I would like to retrieve a customer after it has been
> created,
> > >> or
> > >> > >> > > activated
> > >> > >> > > > etc.
> > >> > >> > > >
> > >> > >> > > > I have coded the logic to send the SMS and email after
> getting
> > >> the
> > >> > >> > > contact
> > >> > >> > > > details, however, I have to get the customer to get the
> contact
> > >> > >> details.
> > >> > >> > > >
> > >> > >> > > > This is the error I get during my call:
> > >> > >> https://pastebin.com/zrebwE8v
> > >> > >> > > >
> > >> > >> > > > I would like to get clarifications on how to set the
> tenant and
> > >> > >> correctly
> > >> > >> > > > make authentication during a rest call.
> > >> > >> > > >
> > >> > >> > > > I would also like to get a better understanding of how to
> use
> > >> the
> > >> > >> Anubis,
> > >> > >> > > > test and identity microservice in this case
> > >> > >> > > >
> > >> > >> > > > *At your service,*
> > >> > >> > > >
> > >> > >> > > > *Ebenezer Graham*
> > >> > >> > > >
> > >> > >> > > > *BSc (Hons) Computing*
> > >> > >> > > >
> > >> > >> > > >
> > >> > >> > > > [image: EmailSignature.png]
> > >> > >> > > >
> > >> > >> > > > African Leadership University,
> > >> > >> > > >
> > >> > >> > > > Power Mill Road, Pamplemousses,
> > >> > >> > > >
> > >> > >> > > > Mauritius.
> > >> > >> > > >
> > >> > >> > > >
> > >> > >> > > > *skype*:
> > >> > >> > > > ebenezer.graham
> > >> > >> > > > GitHub <https://github.com/ebenezergraham> | LinkedIn
> > >> > >> > > > <https://www.linkedin.com/in/ebenezer-graham/> | Twitter
> > >> > >> > > > <https://twitter.com/pactmart> | Facebook
> > >> > >> > > > <https://www.facebook.com/pactmart>
> > >> > >> > > > www.pactmart.com | Freelancing made easy.
> > >> > >> > > >
> > >> > >> > > >
> > >> > >> > > > *“Talk is cheap, show me the code.” *- *Linus Torvalds*
> > >> > >> > > >
> > >> > >> > > >
> > >> > >> > > >
> > >> > >> > > > On 19 May 2018 at 00:41, Ebenezer Graham <
> > >> > egraham15@xxxxxxxxxxxxxx>
> > >> > >> > > wrote:
> > >> > >> > > >
> > >> > >> > > > > Hi everyone,
> > >> > >> > > > >
> > >> > >> > > > > I am Ebenezer a student from the African Leadership
> > >> University
> > >> > >> and I
> > >> > >> > > will
> > >> > >> > > > > be working on this project under the mentorship of Isaac
> > >> Kamga.
> > >> > >> > > > >
> > >> > >> > > > > The idea is to use this thread to discuss the decisions
> being
> > >> > >> made on
> > >> > >> > > > this
> > >> > >> > > > > project so that the community has visibility on what's
> > >> happening
> > >> > >> and
> > >> > >> > > most
> > >> > >> > > > > importantly give constructive feedback.
> > >> > >> > > > >
> > >> > >> > > > > *EventListeners:*
> > >> > >> > > > > This is the Doc
> > >> > >> > > > > <
> > >> > >> > > >
> https://docs.google.com/document/d/1kme5qrxOrO0WGUEvNgzv5XVk
> > >> gWtpg
> > >> > >> > > 0lbX-CrBH4js7o/edit?usp=sharing
> > >> > >> > > > >
> > >> > >> > > > > containing the shortlisted events which I believe qualify
> > >> for an
> > >> > >> Email
> > >> > >> > > or
> > >> > >> > > > > SMS notification. Please review and comment on the doc
> > >> > suggesting
> > >> > >> any
> > >> > >> > > > > addition or deletion or related feedback.
> > >> > >> > > > >
> > >> > >> > > > > *UI for the service:*
> > >> > >> > > > > This is a link <
> https://wireframe.cc/pro/pp/5fb6b2e61167290>
> > >> to
> > >> > >> the
> > >> > >> > > > > wireframes for the UI of the service. Please give
> pointers on
> > >> > what
> > >> > >> > > could
> > >> > >> > > > be
> > >> > >> > > > > added and what should be taken out.
> > >> > >> > > > >
> > >> > >> > > > >
> > >> > >> > > > > *At your service*
> > >> > >> > > > > *,*
> > >> > >> > > > >
> > >> > >> > > > > *Ebenezer Graham*
> > >> > >> > > > >
> > >> > >> > > > > *BSc (Hons) Computing*
> > >> > >> > > > >
> > >> > >> > > > >
> > >> > >> > > > > [image: EmailSignature.png]
> > >> > >> > > > >
> > >> > >> > > > > Beau Plan Business Park | West Building
> > >> > >> > > > >
> > >> > >> > > > > Pamplemousses |  Mauritius
> > >> > >> > > > >
> > >> > >> > > > >
> > >> > >> > > > > <http://www.pactmart.com/>
> > >> > >> > > > > <http://www.pactmart.com/>
> > >> > >> > > > > www.pactmart.com | Freelancing made easy.
> > >> > >> > > > > GitHub <https://github.com/ebenezergraham> | LinkedIn
> > >> > >> > > > > <https://www.linkedin.com/in/ebenezer-graham/> | Twitter
> > >> > >> > > > > <https://twitter.com/pactmart> | Facebook
> > >> > >> > > > > <https://www.facebook.com/pactmart> | Website
> > >> > >> > > > > <http://ebenezergraham.github.io/>
> > >> > >> > > > >
> > >> > >> > > > > *skype*:
> > >> > >> > > > > ebenezer.graham
> > >> > >> > > > > | *Phone*:
> > >> > >> > > > > +230 5840 9206 <+230%205840%209206>
> > >> > >> > > > >
> > >> > >> > > > >
> > >> > >> > > > > *“Practice isn’t the thing you do once you’re good. It’s
> the
> > >> > >> thing you
> > >> > >> > > do
> > >> > >> > > > > that makes you good.”*
> > >> > >> > > > > -*Malcolm Gladwell*
> > >> > >> > > > >
> > >> > >> > > > >
> > >> > >> > > > >
> > >> > >> > > >
> > >> > >> > >
> > >> > >>
> > >> > >
> > >> > >
> > >> >
> > >>
> > >
> > >
>