NServiceBus 5 - Sql Transport not writing audit records - nservicebus

I am using the sql transport and have the following defined in my config file for the sender and endpoint.
<section name="AuditConfig" type="NServiceBus.Config.AuditConfig, NServiceBus.Core" />
<AuditConfig QueueName="audit" />
The tables get successfully created, however, when my message handlers complete successfully and i check the tables no records are present. Is there something else I need to do to get this working?
Thanks

Low and behold this was an error within the outbox and a fix has been committed.
https://github.com/Particular/NServiceBus/issues/2702

Related

UCWA 'Offline' status - invalid

I trying to update my status to Offline (Skype for Business) , by POSTing
{"availability":"Offline"}
to me/presence url.
The response is: 400 Bad request
<code>BadRequest</code>
<subcode>ParameterValidationFailure</subcode>
<message>Please check what you entered and try again.</message>
<debugInfo />
<parameters>
<property name="availability">Invalid</property>
</parameters>
Same happens with 'Away' status,
but statuses like 'Online', 'Busy' work fine.
If you want to change your status to offline, the only solution I know about would be to issue a DELETE request to the application URL specific to that UCWA session. There really isn't an offline-mode for UCWA. The enumeration for Availability includes all the statuses, but sadly not an accurate description of what can/cannot be set via UCWA.
You should be able to set the following statuses:
Away
BeRightBack
Busy
DoNotDisturb
Online
Offline (as stated above) is set as a result of the application no longer existing.
IdleBusy/IdleOnline are states that the server will set when the inactivity timer is trigger in the Busy/Online states.

How to get number rows updated/added when we make DB call via JCA files in osb proxy service

I am as a client inserting/updating/fetching values to/from back-end DB via JCA files creating business service and making the call. I am facing problem while performing insert/update call as for all the request i will be getting success response irrespective of the DB getting added/updated. If there is a way to confirm like these many rows got updated after insert/update DB then it confirms like operation is successful.
Below is the simple JCA file to update the DB, can you please let me know what extra configuration i need to do to get the number of rows get updated..!
<adapter-config name="RetrieveSecCustRelationship" adapter="Database Adapter" wsdlLocation="RetrieveSecCustRelationship.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
<connection-factory location="eis/DB/Database" UIConnectionName="Database" adapterRef=""/>
<endpoint-interaction portType="RetrieveSecCustRelationship_ptt" operation="RetrieveSecCustRelationship">
<interaction-spec className="oracle.tip.adapter.db.DBPureSQLInteractionSpec">
<property name="SqlString" value=**"update CUSTOMER_INSTALLED_PRODUCT set CUSTOMER_ID=? where CUSTOMER_ID=?"**/>
<property name="GetActiveUnitOfWork" value="false"/>
<property name="QueryTimeout" value="6"/>
</interaction-spec>
<input/>
<output/>
</endpoint-interaction>
</adapter-config>
Thanks & Regards
I'm afraid you will need to wrap it in PL/SQL and then extend that PL/SQL so number of affected rows is being returned. Then you could extract this value from response variable with XPath.

Spring integration Error handling - How do I access original faulty message's history?

We have a spring-integration application where we would like to deal with the messages on the error channel.At a minimum we would like to extract the history and log it so we can visualise where exactly it failed etc
Here is a brief markup of just this bit
<int:poller id="defaultPoller" default="true" fixed-delay="5000" />
<int:channel id="MyCustomErrorChannel">
<int:queue capacity="10"/>
</int:channel>
<int:header-enricher id="errorMsg.HeaderEnricher"
input-channel="errorChannel"
output-channel="MyCustomErrorChannel">
<int:header name="history" expression="payload.failedMessage.headers" />
</int:header-enricher>
<int:service-activator input-channel="MyCustomErrorChannel" ref="errorLogger" method="logError"/>
<bean id="errorLogger" class="com.dataprep.util.ErrorLogger" />
The idea is to define our custom error channel MyCustomErrorChannel. Any error that ends up in the default errorChannel gets its header's enriched before being put out on MyCustomErrorChannel
Lastly we have a logger that reads the messages from MyCustomErrorChannel and logs the payload which is the underlying exception and also the history.
I notice that the history in my logger is always 3 steps
errorChannel,errorMsg.HeaderEnricher,pbSwiftRouterErrorChannel i.e nothing prior to this message landing on the errorChannel is obtainable in the history.
How do I get hold of the original message's history (i.e the history of the faulty message which somehow landed on the default error channel as a new Error Message)
Could you please take a look at my header enricher and let me know how to access the headers on the failed message and stuff it to the error message?
Is it doable at all ?
To replace existing headers you should use overwrite="true", because the history is built for the ErrorChannel, too.
You should override exactly with history header, not the whole headers. Therefore your expression must be like this:
<int:header name="history"
expression="payload.failedMessage.headers.history"
overwrite="true"/>

Powerview connection error

When I try to create a powerview report from an excel spreadsheet in Sharepoint, I get the following error message.
Please help
An error occurred while loading the model for the item or data source 'http://win-lnj1eq8qsfv:16350/PowerPivotTestSite/PowerPivot Gallery/Sum of Sales Quota.xlsx'. Verify that the connection information is correct and that you have permissions to access the data source.
<detail>
<ErrorCode xmlns="http://www.microsoft.com/sql/reportingservices">rsCannotRetrieveModel</ErrorCode>
<HttpStatus xmlns="http://www.microsoft.com/sql/reportingservices">400</HttpStatus>
<Message xmlns="http://www.microsoft.com/sql/reportingservices">An error occurred while loading the model for the item or data source 'http://win-lnj1eq8qsfv:16350/PowerPivotTestSite/PowerPivot Gallery/Sum of Sales Quota.xlsx'. Verify that the connection information is correct and that you have permissions to access the data source.</Message>
<HelpLink xmlns="http://www.microsoft.com/sql/reportingservices">http://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&EvtID=rsCannotRetrieveModel&ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=11.0.2100.60</HelpLink>
<ProductName xmlns="http://www.microsoft.com/sql/reportingservices">Microsoft SQL Server Reporting Services</ProductName>
<ProductVersion xmlns="http://www.microsoft.com/sql/reportingservices">11.0.2100.60</ProductVersion>
<ProductLocaleId xmlns="http://www.microsoft.com/sql/reportingservices">127</ProductLocaleId>
<OperatingSystem xmlns="http://www.microsoft.com/sql/reportingservices">OsIndependent</OperatingSystem>
<CountryLocaleId xmlns="http://www.microsoft.com/sql/reportingservices">1033</CountryLocaleId>
<MoreInformation xmlns="http://www.microsoft.com/sql/reportingservices">
<Source>ReportingServicesLibrary</Source>
<Message msrs:ErrorCode="rsCannotRetrieveModel" msrs:HelpLink="http://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&EvtID=rsCannotRetrieveModel&ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=11.0.2100.60" xmlns:msrs="http://www.microsoft.com/sql/reportingservices">An error occurred while loading the model for the item or data source 'http://win-lnj1eq8qsfv:16350/PowerPivotTestSite/PowerPivot Gallery/Sum of Sales Quota.xlsx'. Verify that the connection information is correct and that you have permissions to access the data source.</Message>
<MoreInformation>
<Source>Microsoft.ReportingServices.ProcessingCore</Source>
<Message msrs:ErrorCode="rsErrorOpeningConnection" msrs:HelpLink="http://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&EvtID=rsErrorOpeningConnection&ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=1.0" xmlns:msrs="http://www.microsoft.com/sql/reportingservices">Cannot create a connection to data source 'TemporaryDataSource'.</Message>
<MoreInformation>
<Source>Microsoft.AnalysisServices.AdomdClient</Source>
<Message>A connection cannot be made. Ensure that the server is running.</Message>
<MoreInformation>
<Source>Microsoft.AnalysisServices.SharePoint.Integration</Source>
<Message></Message>
<MoreInformation>
<Source>Microsoft.AnalysisServices.SharePoint.Integration</Source>
<Message>The PowerPivot service application could not connect to the Analysis Services instance.</Message>
</MoreInformation>
</MoreInformation>
</MoreInformation>
</MoreInformation>
</MoreInformation>
<Warnings xmlns="http://www.microsoft.com/sql/reportingservices" />
</detail>
Basically if you read through the error you can see that it cannot open a connection to the data source TemporaryDataSource:
<Message msrs:ErrorCode="rsErrorOpeningConnection" ....
Cannot create a connection to data source 'TemporaryDataSource'.
</Message>
Check that you can access the Datasource manually - the connection string builder dialog should have a 'Test Connection' button.

Maximum number of messages sent to a Queue in OpenMQ?

I am currently using Glassfish v2.1 and I have set up a queue to send and receive messages from with Sesion beans and MDBs respectively. However, I have noticed that I can send only a maximum of 1000 messages to the queue. Is there any reason why I cannot send more than 1000 messages to the queue? I do have a "developer" profile setup for the glassfish domain. Could that be the reason? Or is there some resource configuration setting that I need to modify?
I have setup the sun-resources.xml configuration properties as follows:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE resources PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Resource Definitions //EN" "http://www.sun.com/software/appserver/dtds/sun-resources_1_3.dtd">
<resources>
<admin-object-resource
enabled="true"
jndi-name="jms/UpdateQueue"
object-type="user"
res-adapter="jmsra"
res-type="javax.jms.Queue">
<description/>
<property name="Name" value="UpdatePhysicalQueue"/>
</admin-object-resource>
<connector-resource
enabled="true" jndi-name="jms/UpdateQueueFactory"
object-type="user"
pool-name="jms/UpdateQueueFactoryPool">
<description/>
</connector-resource>
<connector-connection-pool
associate-with-thread="false"
connection-creation-retry-attempts="0"
connection-creation-retry-interval-in-seconds="10"
connection-definition-name="javax.jms.QueueConnectionFactory"
connection-leak-reclaim="false"
connection-leak-timeout-in-seconds="0"
fail-all-connections="false"
idle-timeout-in-seconds="300"
is-connection-validation-required="false"
lazy-connection-association="false"
lazy-connection-enlistment="false"
match-connections="true"
max-connection-usage-count="0"
max-pool-size="32"
max-wait-time-in-millis="60000"
name="jms/UpdateFactoryPool"
pool-resize-quantity="2"
resource-adapter-name="jmsra"
steady-pool-size="8"
validate-atmost-once-period-in-seconds="0"/>
</resources>
Hmm .. further investigation revealed the following in the imq logs:
[17/Nov/2009:10:27:57 CST] ERROR sendMessage: Sending message failed. Connection ID: 427038234214377984:
com.sun.messaging.jmq.jmsserver.util.BrokerException: transaction failed: [B4303]: The maximum number of messages [1,000] that the producer can process in a single transaction (TID=427038234364096768) has been exceeded. Please either limit the # of messages per transaction or increase the imq.transaction.producer.maxNumMsgs property.
So what would I do if I needed to send more than 5000 messages at a time?
What I am trying to do is to read all the records in a table and update a particular field of each record based on the corresponding value of that record in a legacy table to which I have only read only access. This table has more than 10k records in it. As of now, I am sequentially going through each record in a for loop, getting the corresponding record from the legacy table, comparing the field values, updating the record if necessary and adding corresponding new records in other tables.
However, I was hoping to improve performance by processing all the records asynchronously. To do that I was thinking of sending each record info as a separate message and hence requiring so many messages.
To configure OpenMQ and set artitrary broker properties, have a look at this blog post.
But actually, I wouldn't advice to increase the imq.transaction.producer.maxNumMsgs property, at least not above the value recommended in the documentation:
The maximum number of messages that a producer can process in a single transaction. It is recommended that the value be less than 5000 to prevent the exhausting of resources.
If you need to send more messages, consider doing it in several transactions.