My class ***UserSynchronizer like CmsUserSynchronizer in abp module cms-kit not exec - abp

Task HandleEventAsync(EntityUpdatedEto eventData) in my class ***UserSynchronizer don't exec When I create or update user,why?

I don't know if your problem has been resolved, but if not, consider looking at the resources below.
https://docs.abp.io/en/abp/latest/Local-Event-Bus#events-with-past-tense
Code sample from abp repo similar to your purpose:
https://github.com/abpframework/abp/blob/dev/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/FullSearch/Elastic/DocumentChangedEventHandler.cs

Related

serenity-bdd with cucumber feature hooks

I am using Serenity-BDD with cucumber and I would like to run certain things only once per feature file. It looks like cucumber doesn't support this at the moment. I was wondering if serenity has some workaround for this.
I've also tried to use the JUnit #BeforeClass, #AfterClass hooks in the test suite class but the 2 annotations require static methods and I cannot access the serenity page objects methods at that time (there is no instance injected at that point in time).
You could try setting up a static global flag which will make sure that the before method will runs only once.
Setup the feature file with a tag.
#RunOnce
Feature: Run Once
Use the following hook in your stepdefinition.
private static boolean onceFlag = true;
#Before(value="#RunOnce")
public void beforeOnce(){
if(onceFlag) {
onceFlag = false;
//Your code to write once per feature file
}
}
You could try to implement net.thucydides.core.steps.StepListener interface and connect it via SPI. I described this in answer in this post

Turn off Hystrix functionality

I am integrating Hystrix in an application. That application is already in production and we will be testing out hystrix integration work in sandbox before we will push it to production.
My question is that is there any way to turn on/off hystrix functionality using some configuration setting?
There is no single setting for this. You'll need to set multiple parameters to disable Hystrix.
See https://github.com/Netflix/Hystrix/wiki/Configuration for the configuration options:
hystrix.command.default.execution.isolation.strategy=SEMAPHORE
hystrix.command.default.execution.isolation.semaphore.maxConcurrentRequests=100000 # basically 'unlimited'
hystrix.command.default.execution.timeout.enabled=false
hystrix.command.default.circuitBreaker.enabled=false
hystrix.command.default.fallback.enabled=false
Please double check your version of Hystrix for the available parameters.
This is all what you need:
# Disable Circuit Breaker (Hystrix)
spring:
cloud:
circuit:
breaker:
enabled: false
hystrix:
command:
default:
circuitBreaker:
enabled: false
As ahus1 said, there is no single way to disable Hystrix entirely. To disable it in our application, we decided it was cleanest and safest to put a HystrixCommand in a wrapper class, and that wrapper class only exposed the parts of the HystrixCommand that we used (in our case, the execute() method). When constructing the wrapper class, we pass it a Callable that contains the code we want executed, and if Hystrix is disabled (according to our own config value), we simply call that Callable without ever creating a HystrixCommand. This avoids executing any Hystrix code whatsoever and makes it easier to say that Hystrix isn't affecting our application at all when it's disabled.
There are a couple of ways to achieve this-
Doing this for your every group including default. Although this will not disable hystrix(it will only keep the circuit closed all the time) but you will achieve the same result-
hystrix.command.{group-key}.circuitBreaker.forceClosed=false
If you are using java, you can create an around advice over #HystrixCommand annotation and bypass hystrix execution based upon a flag.
Java Code for #2-
#Pointcut("#annotation(com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand)")
public void hystrixCommandAnnotationPointcut() {
}
#Around("hystrixCommandAnnotationPointcut()")
public Object methodsAnnotatedWithHystrixCommand(final ProceedingJoinPoint joinPoint) throws Throwable {
Object result = null;
Method method = AopUtils.getMethodFromTarget(joinPoint);
if ((System.getProperty(enable.hystrix).equals("true")) {
result = joinPoint.proceed();
} else {
result = method.invoke(joinPoint.getTarget(), joinPoint.getArgs());
}
return result;
}
If your Project is spring Managed you can comment the bean definition of hystrixAspect in applicationContext.xml
Comment the following line
bean id="hystrixAspect"class="com.netflix.hystrix.contrib.javanica.aop.aspectj.HystrixCommandAspect"/>
This will remove Hystrix from your project.
I ran into this situation where I wanted to completely turnoff Hystrix using a single property (We use IBM uDeploy to manage dynamic properties). We are using javanica library built on top of Hystrix
Create a Configuration class which creates the HystrixCommandAspect
#Configuration
public class HystrixConfiguration{
#Bean(name = "hystrixCommandAspect")
#Conditional(HystrixEnableCondition.class)
public HystrixCommandAspect hystrixCommandAspect(){
return new HystrixCommandAspect()}
}
2. And the conditional class would be enabled based on a system property.
public class HystrixEnableCondition implements Condition{
#Override
public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata){
return
"YES".equalsIgnoreCase(
context.getEnvironment().getProperty("circuitBreaker.enabled")) ||
"YES".equalsIgnoreCase(
System.getProperty("circuitBreaker.enabled"));
}
}
setting
hystrix.command.default.execution.isolation.strategy=SEMAPHORE
is enough.
Additionally you may or should disable also the timeout threads
with hystrix.command.default.execution.timeout.enabled=false

Nancyfx localization

I'm testing localization in Nancy and able to get it to work using EMBEDDED resource files but the issue is I don't want embedded resource files because I want them to be allowed to be edited via the GUI or using the file (if I go the DB route or setting the resource file as "content").
According to the doucmentation you should be able to override it to support using a database but I'm unable to get this to work (https://github.com/NancyFx/Nancy/wiki/Localization):
public class ResourceManager : ResourceBasedTextResource
{
public ResourceManager(IResourceAssemblyProvider resourceAssemblyProvider) : base(resourceAssemblyProvider)
{
}
public new string this[string key, NancyContext context]
{
get
{
return "HELO!";
}
}
}
This was just me messing around but I was hoping in the Razor view when I did #Text.Localization. it should return "HELO!" for everything... however it is not working
There really isn't a question in your post so I'm going to have to guess a bit and assume that you're not getting any exception but rather you're not seeing the "HELO!" in your view
Simply implementing a new ResourceBasedTextResource class is not enough. This is a core component and as such you are going to explicitly have to tell Nancy to use it. You do this by overriding the InternalConfiguration property of your Bootstrapper and tell Nancy to use your implementation instead
You can see it in the DemoBootstrapper of the demo that is linked from that wiki page https://github.com/NancyFx/Nancy/blob/8970ac9d6c7cf46e6060f0b83117c19fa18085c2/src/Nancy.Demo.Razor.Localization/DemoBootstrapper.cs#L11
Also, if you are not going to use resource files, then you should look into inheriting from ITextResource interface instead. It's a simple interface so it should be straight forward.
HTH

4004 RIA Service error - Remote database

After finaly be abble to setup my silverlight app with RIA, I call the following code to get my list of citie objects from my remote database:
_context = context;
var load =_context.Load(_context.GetCitiesQuery());
_cities = new ObservableCollection<City>(load.Entities);
I get no errors, but also no data. After using fiddler I do see that I get a responce looking like this:
#GetCitiesResponsehttp://tempuri.org/#GetCitiesResult aDomainServices i)http://www.w3.org/2001/XMLSchema-instance^
TotalCount�^
RootResults b4http://schemas.datacontract.org/2004/07/Gymsport.Web_City_CityID�_CityName�Oelegem_PostCode�� _City_CityID�_CityName�Ranst_PostCode�� _City_CityID�_CityName�Emblem_PostCode�� _City_CityID�_CityName�Ranst_PostCode��
Which is a lot of rubbish, but between the lines you can read it returns a couple of cities.
But for some reason my silverlight app doens't pick up on those.
Any suggestions on how to look for a solution?
Thanks in advance.
Grtz
T
Solution:
I had to work with the EntityList object to convert the result of the query to an observable collection. Thank you Firefox ErrorConsole :)

DNN Scheduler won't run my custom schedule

I have created a class Library and made sure it inherits
DotNetNuke.Services.Scheduling.SchedulerClient
And have then overrided the DoWork() sub.
Then in dnn host settings > scheduler added a new scheduler Item.
in the textbox marked : Full Class Name and Assembly:
Namespace.Classname, Dllname
checked the Enable Schedule box and added a run time interval of 5mins and enabled catch up.
also added the list of tables that the class uses. and keep 5 records of history
I then saved it,
In the view schedule Status I get this:
Name | Next Start | OverDue(s) | Time Remaining
Sub reminder | 11/12/2010 9:52:02 AM | 3.5 | 0
Using the scheduler in request mode.
Thanks in advance for any help.
Update :
Ok, I created a new class library project called "SubRenewal"
Renamed the vb file Test and added the below to the file
Namespce Matts
Public Class Test
Inherits Dnn.Services.Scheduling.SchedulerClient
Public overrides Sub DoWork()
Me.ScheduleHistoryItem.addLogNote("I ran")
end Sub
End Class
End Namespace
On the Scheduler Page I put :
Friendly Name Tester
Full Class name and assembly Matts.Test,SubRenwal
Enabled Yes
Time Lapse 10 s
Rety frequency -
Run on Event None
And left everything else blank and saved it. Still nothing in Scheduler or Item History. Also theres nothing in the event viewer
I would suggest following steps to get started with scheduler development and debugging:
Create a new class library probject and add reference of dotnetnuke and related dlls in it
add reference of the same project to your dnn project
add a new vb or c# file to implement scheduler
add code lines to create entries in schedule history and no other code
test your scheduler
register your new scheduler from dotentnuke website host account
Please note that as soon as you add a new scheduler item, it will fire the scheduler.
I hope this will help you. I will suggest to remove the entry of scheduler you already having, reset your website instance ( iis or asp.net development server) and try adding it again using the above method
Hope this will help you
Firstly Id Like to thank Lakhlan, for his help without him I wouldnt of spotted the mistake.
I beleive the issue was one of two things first one is that I was registering a reference to another custom module to allow me to localise some of the output text.
Also I added the new constructor below
Public Sub New(ByVal objSceduleHistoryItem As DotNetNuke.Services.Scheduling.ScheduleHistoryItem)
MyBase.New()
Me.ScheduleHistoryItem = objSceduleHistoryItem
End Sub
Thanks again would up vote you for your help but cant :(

Resources