Can't set confirmationHandler on a connection with confirmation-window-size < 0 error when deployBridge with DEFAULT_CONFIRMATION_WINDOW_SIZE(-1) - activemq-artemis

I try to deploy Core Bridge via ActiveMQServer.deployBridge(BridgeConfiguration config), I create BridgeConfiguration with default value (DEFAULT_CONFIRMATION_WINDOW_SIZE = -1) for confirmationWindowSize
and put it in ActiveMQServer.deployBridge(BridgeConfiguration config), but after that, I get the errors
You can't set confirmationHandler on a connection with
confirmation-window-size < 0. Look at the documentation for more
information.
What am I doing wrong or is it a bug?
Artemis version 2.16.0

This looks like a minor bug with the default value for org.apache.activemq.artemis.core.config.BridgeConfiguration#confirmationWindowSize. Currently it is using this:
private int confirmationWindowSize = ActiveMQClient.DEFAULT_CONFIRMATION_WINDOW_SIZE;
However, it should be using this:
private int confirmationWindowSize = ActiveMQDefaultConfiguration.getDefaultBridgeConfirmationWindowSize();
You can work around this issue by setting the confirmation window size manually, e.g.:
BridgeConfiguration myBridgeConfiguration = new BridgeConfiguration();
myBridgeConfiguration.setConfirmationWindowSize(ActiveMQDefaultConfiguration.getDefaultBridgeConfirmationWindowSize());
I opened a Jira issue for this, sent a PR, and the PR has been merged. The fix will appear in ActiveMQ Artemis 2.17.0.

Related

Using IncludePackageName = false in AddServiceFabricConfiguration does not change setting in Service Fabric AspNetCore config?

I'm trying to get rid of the "Config:" prefix added by AddServiceFabricConfiguration with AspNet Core to follow the same naming regardless of configuration source.
According to the documentation you should set IncludePackageName = false which I do like this:
.ConfigureAppConfiguration(builder => {
builder.AddServiceFabricConfiguration(serviceContext.CodePackageActivationContext, options => options.IncludePackageName = false);
})
But when I'm running the application the configuration is populated like this with IncludePackageName set to true anyway.
How can I make this setting work? The ServiceFabricConfigurationProvider which the helper adds is not public so I can't find a suitable workaround.
Update: This seems to have been some issue with my local environment rather than the actual code. Reboot, clean and rebuild fixed the issue.

Add non-standard segments with nhapi

My system has to generate an xml in which the node ORM_O01.ORDER_DETAIL must contain the node ORM_O01.OBRRQDRQ1RXOODSODT_SUPPGRP, because it has to communicate with Mirth.
I am using the nhapi library version 2.5, in which this node does not contain it.
var obr = _ormO01Message.GetORDER().ORDER_DETAIL.OBR;
obr.SetIDOBR.Value = "1";
obr.PlacerOrderNumber.EntityIdentifier.Value = "123456";
obr.PlacerOrderNumber.NamespaceID.Value = "6543";
obr.PlacerOrderNumber.UniversalID.Value = "10009";
obr.UniversalServiceIdentifier.Identifier.Value = "NS";
Is it possible to add a node in ORM_O01.ORDER_DETAIL that is not standard?
Thanks.
<ORM_O01.ORDER_DETAIL>
<ORM_O01.OBRRQDRQ1RXOODSODT_SUPPGRP>
<OBR>
<OBR.1>1</OBR.1>
<OBR.2>
<EI.1>123456</EI.1>
<EI.2>6543</EI.2>
<EI.3>10009</EI.3>
</OBR.2>
<OBR.4>
<CE.1>NS</CE.1>
</OBR.4>
</OBR>
</ORM_O01.OBRRQDRQ1RXOODSODT_SUPPGRP>
</ORM_O01.ORDER_DETAIL>
ORM_O01.OBRRQDRQ1RXOODSODT_SUPPGRP looks like it actually is standard for 2.5, but neither nhapi or hapi (which mirth uses) include it. I wouldn't worry about trying to add it in because mirth probably wouldn't be able to parse it if you did.
See similar issue where a mirth user needed to strip that group out.

How to set the offset.commit.policy to AlwaysCommitOffsetPolicy in debezium?

I created a Debezium Embedded engine to capture MySQL change data. I want to commit the offsets as soon as I can. In the code, the config is created including follows.
.with("offset.commit.policy",OffsetCommitPolicy.AlwaysCommitOffsetPolicy.class.getName())
Running this returns, java.lang.NoSuchMethodException: io.debezium.embedded.spi.OffsetCommitPolicy$AlwaysCommitOffsetPolicy.<init>(io.debezium.config.Configuration)
However, When I start the embedded engine with,
.with("offset.commit.policy",OffsetCommitPolicy.PeriodicCommitOffsetPolicy.class.getName()), the embedded engine works fine.
Note that the class OffsetCommitPolicy.PeriodicCommitOffsetPolicy constructor includes the config parameter while OffsetCommitPolicy.AlwaysCommitOffsetPolicy doesn't.
public PeriodicCommitOffsetPolicy(Configuration config) {
...
}
How to get the debezium embedded engine to use its AlwaysCommitOffsetPolicy?
Thanks for the report. This is partly bug (which we would appreciate if you could log into our Jira). You can solve this issue by calling a dedicated method embedded engine builder like `io.debezium.embedded.EmbeddedEngine.create().with(OffsetCommitPolicy.always())'
Tested with version 1.4.0Final:
new EmbeddedEngine.BuilderImpl() // create builder
.using(config) // regular config
.using(OffsetCommitPolicy.always()) // explicit commit policy
.notifying(this::handleEvent) // even procesor
.build(); // and finally build!

Error when trying to update Enterprise Architect StateMachine Connector in Jscript

When Updating a Enterprise Architect connector i get the following Error Message:
StateFlow is not legal for State --> State, Line:47
The reason I want to update is that I want to add a Stereotype to one of my connectors.
I have sorted out a Specific EA.Element via SQL Quierie searching for 1 GUID.
"SELECT * FROM t_object WHERE ea_guid='<Some specific GUID>'"
From this Element I have selected the only connector that is a selftransition.
If i understand correctly i have to set the selftransition tag, and then update the connector. But when i update, the Error message above is shown.
My code:
if(element.Elements.Count!=0)//element is Propably a comp state or Statemachine
{
connectors = element.Connectors;
for(var j = 0; j<connectors.Count; j++)
{
connector = connectors.GetAt(j);
if(connector.ClientID == connector.SupplierID)
{
tempElement = element;
connector.Stereotype="New Stereotype";
connector.Update();
}
}
}
The Red Transition in the picture is the Transition that throws the error.
What does the Error mean and why cant i update the connector?
If you have other suggestions how to add a stereotype to a connector i would gladly apreciate them.
That seems to be a bug, since StateFlow seems like a legitimate connector type between two States.
You can try unchecking the strict connector syntax setting in the options
If you still have this issue in the latest version then you can report it as a bug
If nothing helps you can always try to go around the API and to the database directly.
Try something like
Repository.Execute("update t_connector set stereotype = 'MyStereo' where connector_ID = 1234");
Replacing 1234 by the actual connector_ID of course.

CRM 2011 - CloseIncidentRequest - Throws Exception when registered on Create Case Post Event

I am trying to get a plugin registered on the case ("incident") create post synchronous event to successfully call the CloseIncidentRequest. I have the CloseIncidentRequest working successfully on the case update post event but on the create I keep getting the "Need to start a transaction before commit" exception.
Does anyone know if this is a known issue, or has anyone got this running on the case create post event? I have seen posts around changing from synchronous to asynch - and if I change the plugin to run asynch, that does work - but ideally I want this to run this synchronously, so that the user can see that the case has been resolved when pressing save.
private const int IncidentResolutionStatus_Closed = 2;
private const int IncidentStatusCode_ProblemSolved = 5;
Entity resolution = new Entity("incidentresolution");
resolution["subject"] = "Case Resolved";
resolution["incidentid"] = new EntityReference("incident", IncidentId);
resolution["timespent"] = timespent;
resolution["statuscode"] = new OptionSetValue(IncidentResolutionStatus_Closed);
CloseIncidentRequest closeincidentRequest = new CloseIncidentRequest()
{
IncidentResolution = resolution,
Status = new OptionSetValue((int)IncidentStatusCode_ProblemSolved)
};
service.Execute(closeincidentRequest);
Try resolving the case manually (through the CRM interface) and you probably will get the same error (like me).
If so it's not related to your plugin code (or SDK), but on some missing information when you created the case.
Check if on the case you are trying to resolve there is no missing required field. In my case the error was that the Client name was null (there was a client record but its name was null) and it was causing the error.